Part Number Hot Search : 
IL9010N 00095 MA3JP02F TDA1518 LA4708 LB1848MC RFP7N35 R200CHX
Product Description
Full Text Search
 

To Download 12F629 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2003 microchip technology inc. ds41190c pic12F629/675 data sheet 8-pin flash-based 8-bit cmos microcontrollers .com .com .com 4 .com u datasheet
ds41190c - page ii ? 2003 microchip technology inc. information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. no representation or warranty is given and no liability is assumed by microchip technology incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. use of microchip?s products as critical components in life support systems is not authorized except with express written approval by microchip. no licenses are conveyed, implicitly or otherwise, under any intellectual property rights. trademarks the microchip name and logo, the microchip logo, k ee l oq , mplab, pic, picmicro, picstart, pro mate and powersmart are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. filterlab, micro id , mxdev, mxlab, picmaster, seeval and the embedded control solutions company are registered trademarks of microchip technology incorporated in the u.s.a. accuron, dspic, dspicdem.net, economonitor, fansense, flexrom, fuzzylab, in-circuit serial programming, icsp, icepic, microport, migratable memory, mpasm, mplib, mplink, mpsim, picc, pickit, picdem, picdem.net, powercal, powerinfo, powertool, rfpic, rflab, select mode, smartsensor, smartshunt, smarttel and total endurance are trademarks of microchip technology incorporated in the u.s.a. and other countries. serialized quick turn programming (sqtp) is a service mark of microchip technology incorporated in the u.s.a. all other trademarks mentioned herein are property of their respective companies. ? 2003, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. microchip received qs-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona in july 1999 and mountain view, california in march 2002. the company?s quality system processes and procedures are qs-9000 compliant for its picmicro ? 8-bit mcus, k ee l oq ? code hopping devices, serial eeproms, microperipherals, non-volatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001 certified. note the following details of the code protection feature on microchip devices:  microchip products meet the specification contained in their particular microchip data sheet.  microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions.  there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip products in a manner outside the operating specifications contained in microchip's data sheets. most likely, the person doing so is engaged in theft of intellectual property.  microchip is willing to work with the customer who is concerned about the integrity of their code.  neither microchip nor any other semiconductor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are committed to continuously improving the code protection features of our products. attempts to break microchip?s code protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 1 pic12F629/675 high performance risc cpu:  only 35 instructions to learn - all single cycle instructions except branches  operating speed: - dc - 20 mhz oscillator/clock input - dc - 200 ns instruction cycle  interrupt capability  8-level deep hardware stack  direct, indirect, and relative addressing modes special microcontroller features:  internal and external oscillator options - precision internal 4 mhz oscillator factory calibrated to 1% - external oscillator support for crystals and resonators -5 s wake-up from sleep, 3.0v, typical  power saving sleep mode  wide operating voltage range - 2.0v to 5.5v  industrial and extended temperature range  low power power-on reset (por)  power-up timer (pwrt) and oscillator start-up timer (ost)  brown-out detect (bod)  watchdog timer (wdt) with independent oscillator for reliable operation  multiplexed mclr /input-pin  interrupt-on-pin change  individual programmable weak pull-ups  programmable code protection  high endurance flash/eeprom cell - 100,000 write flash endurance - 1,000,000 write eeprom endurance - flash/data eeprom retention: > 40 years low power features:  standby current: - 1 na @ 2.0v, typical  operating current: -8.5 a @ 32 khz, 2.0v, typical -100 a @ 1 mhz, 2.0v, typical  watchdog timer current - 300 na @ 2.0v, typical  timer1 oscillator current: -4 a @ 32 khz, 2.0v, typical peripheral features:  6 i/o pins with individual direction control  high current sink/source for direct led drive  analog comparator module with: - one analog comparator - programmable on-chip comparator voltage reference (cv ref ) module - programmable input multiplexing from device inputs - comparator output is externally accessible  analog-to-digital converter module (pic12f675): - 10-bit resolution - programmable 4-channel input - voltage reference input  timer0: 8-bit timer/counter with 8-bit programmable prescaler  enhanced timer1: - 16-bit timer/counter with prescaler - external gate input mode - option to use osc1 and osc2 in lp mode as timer1 oscillator, if intosc mode selected  in-circuit serial programming tm (icsp tm ) via two pins * 8-bit, 8-pin devices protected by microchip?s low pin count patent: u.s. patent no. 5,847,450. additional u.s. and foreign patents and applications may be issued or pending. device program memory data memory i/o 10-bit a/d (ch) comparators timers 8/16-bit flash (words) sram (bytes) eeprom (bytes) pic12F629 1024 64 128 6 ? 1 1/1 pic12f675 1024 64 128 6 4 1 1/1 8-pin flash-based 8-bit cmos microcontroller .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 2 ? 2003 microchip technology inc. pin diagrams v ss v dd gp5/t1cki/osc1/clkin gp4/an3/t1g /osc2/clkout gp3/mclr /v pp gp0/an0/cin+/icspdat gp1/an1/cin-/v ref /icspclk gp2/an2/t0cki/int/cout 1 2 3 45 6 7 8 pic12f675 v ss v dd gp5/t1cki/osc1/clkin gp4/t1g /osc2/clkout gp3/mclr /v pp gp0/cin+/icspdat gp1/cin-/icspclk gp2/t0cki/int/cout 1 2 3 45 6 7 8 pic12F629 8-pin pdip, soic, dfn-s .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 3 pic12F629/675 table of contents 1.0 device overview ............................................................................................................. ............................................................ 5 2.0 memory organization......................................................................................................... ......................................................... 7 3.0 gpio port .................................................................................................................. ............................................................... 19 4.0 timer0 module ............................................................................................................... ........................................................... 27 5.0 timer1 module with gate control ............................................................................................. ................................................ 30 6.0 comparator module ........................................................................................................... ....................................................... 35 7.0 analog-to-digital converter (a/d) module (pic12f675 only) .................................................................. ................................. 41 8.0 data eeprom memory ......................................................................................................... ................................................... 47 9.0 special features of the cpu ................................................................................................ .................................................... 51 10.0 instruction set summary ................................................................................................... ........................................................ 69 11.0 development support ....................................................................................................... ........................................................ 77 12.0 electrical specifications ................................................................................................. ........................................................... 83 13.0 dc and ac characteristics graphs and tables ............................................................................... ...................................... 105 14.0 packaging information ..................................................................................................... ....................................................... 115 appendix a: data sheet revision history ....................................................................................... .................................................. 121 appendix b: device differences ................................................................................................ ....................................................... 121 appendix c: device migrations ................................................................................................. ........................................................ 122 appendix d: migrating from other picmicro ? devices ...................................................................................................................... 122 index .......................................................................................................................... ....................................................................... 123 on-line support ............................................................................................................... ................................................................. 127 systems information and upgrade hot line ...................................................................................... ............................................... 127 reader response ............................................................................................................... .............................................................. 128 product identification system ................................................................................................. .......................................................... 129 to our valued customers it is our intention to provide our valued customers with the best documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publications to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments regarding this publication, please contact the marketing communications department via e-mail at docerrors@mail.microchip.com or fax the reader response form in the back of this data sheet to (480) 792-4150. we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data sheet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the version number, (e.g., ds30000a is version a of document ds30000). errata an errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for curren t devices. as device/documentation issues become known to us, we will publish an errata sheet. the errata will specify the revisi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a particular device, please check with one of the following:  microchip?s worldwide web site; http://www.microchip.com  your local microchip sales office (see last page)  the microchip corporate literature center; u.s. fax: (480) 792-7277 when contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (inclu de liter- ature number) you are using. customer notification system register on our web site at www.microchip.com/cn to receive the most current information on all of our products. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 4 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 5 pic12F629/675 1.0 device overview this document contains device specific information for the pic12F629/675. additional information may be found in the picmicro tm mid-range reference manual (ds33023), which may be obtained from your local microchip sales representative or downloaded from the microchip web site. the reference manual should be considered a complementary document to this data sheet, and is highly recommended reading for a better understanding of the device architecture and operation of the peripheral modules. the pic12F629 and pic12f675 devices are covered by this data sheet. they are identical, except the pic12f675 has a 10-bit a/d converter. they come in 8-pin pdip, soic, and mlf-s packages. figure 1-1 shows a block diagram of the pic12F629/675 devices. table 1-1 shows the pinout description. figure 1-1: pic12F629/675 block diagram flash program memory 1k x 14 13 data bus 8 14 program bus instruction reg program counter 8-level stack (13-bit) ram file registers 64 x 8 direct addr 7 addr (1) 9 addr mux indirect addr fsr reg status reg mux alu w reg power-up timer oscillator start-up timer power-on reset watchdog timer instruction decode & control osc1/clkin osc2/clkout v dd , v ss 8 8 brown-out detect 8 3 timing generation gp5/t1cki/osc1/clkin internal 4 mhz ram gp4/an3/t1g /osc2/clkout gp3/mclr /v pp gp2/an2/t0cki/int/cout gp1/an1/cin-/v ref gp0/an0/cin+ oscillator note 1: higher order bits are from status register. analog timer0 timer1 data eeprom 128 bytes eedata eeaddr comparator analog to digital converter (pic12f675 only) an0 an1 an2 an3 cin- cin+ cout t0cki t1cki v ref and reference t1g 8 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 6 ? 2003 microchip technology inc. table 1-1: pic12F629/675 pinout description name function input type output type description gp0/an0/cin+/icspdat gp0 ttl cmos bi-directional i/o w/ programmable pull-up and interrupt-on-change an0 an a/d channel 0 input cin+ an comparator input icspdat ttl cmos serial programming i/o gp1/an1/cin-/v ref / icspclk gp1 ttl cmos bi-directional i/o w/ programmable pull-up and interrupt-on-change an1 an a/d channel 1 input cin- an comparator input v ref an external voltage reference icspclk st serial programming clock gp2/an2/t0cki/int/cout gp2 st cmos bi-directional i/o w/ programmable pull-up and interrupt-on-change an2 an a/d channel 2 input t0cki st tmr0 clock input int st external interrupt cout cmos comparator output gp3/mclr /v pp gp3 ttl input port w/ interrupt-on-change mclr st master clear v pp hv programming voltage gp4/an3/t1g /osc2/ clkout gp4 ttl cmos bi-directional i/o w/ programmable pull-up and interrupt-on-change an3 an a/d channel 3 input t1g st tmr1 gate osc2 xtal crystal/resonator clkout cmos f osc /4 output gp5/t1cki/osc1/clkin gp5 ttl cmos bi-directional i/o w/ programmable pull-up and interrupt-on-change t1cki st tmr1 clock osc1 xtal crystal/resonator clkin st external clock input/rc oscillator connection v ss v ss power ground reference v dd v dd power positive supply legend: shade = pic12f675 only ttl = ttl input buffer, st = schmitt trigger input buffer .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 7 pic12F629/675 2.0 memory organization 2.1 program memory organization the pic12F629/675 devices have a 13-bit program counter capable of addressing an 8k x 14 program memory space. only the first 1k x 14 (0000h - 03ffh) for the pic12F629/675 devices is physically imple- mented. accessing a location above these boundaries will cause a wrap around within the first 1k x 14 space. the reset vector is at 0000h and the interrupt vector is at 0004h (see figure 2-1). figure 2-1: program memory map and stack for the pic12F629 /675 2.2 data memory organization the data memory (see figure 2-2) is partitioned into two banks, which contain the general purpose regis- ters and the special function registers. the special function registers are located in the first 32 locations of each bank. register locations 20h-5fh are general purpose registers, implemented as static ram and are mapped across both banks. all other ram is unimplemented and returns ?0? when read. rp0 (status<5>) is the bank select bit.  rp0 = 0 bank 0 is selected  rp0 = 1 bank 1 is selected 2.2.1 general purpose register file the register file is organized as 64 x 8 in the pic12F629/675 devices. each register is accessed, either directly or indirectly, through the file select register fsr (see section 2.4). pc<12:0> 13 000h 0004 0005 03ffh 0400h 1fffh stack level 1 stack level 8 reset vector interrupt vector on-chip program memory call, return retfie, retlw stack level 2 note: the irp and rp1 bits status<7:6> are reserved and should always be maintained as ?0?s. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 8 ? 2003 microchip technology inc. 2.2.2 special function registers the special function registers are registers used by the cpu and peripheral functions for controlling the desired operation of the device (see table 2-1). these registers are static ram. the special registers can be classified into two sets: core and peripheral. the special function registers associated with the ?core? are described in this section. those related to the operation of the peripheral features are described in the section of that peripheral feature. figure 2-2: data memory map of the pic12F629/675 indirect addr. (1) tmr0 pcl status fsr gpio pclath intcon pir1 tmr1l tmr1h t1con 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0ah 0bh 0ch 0dh 0eh 0fh 10h 11h 12h 13h 14h 15h 16h 17h 18h 19h 1ah 1bh 1ch 1dh 1eh 1fh 20h 7fh bank 0 unimplemented data memory locations, read as '0'. 1: not a physical register. 2: pic12f675 only. cmcon vrcon general purpose registers accesses 20h-5fh 64 bytes eedata eeadr eecon2 (1) 5fh 60h file address file address wpu ioc indirect addr. (1) option_reg pcl status fsr trisio pclath intcon pie1 pcon osccal 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8ah 8bh 8ch 8dh 8eh 8fh 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9ah 9bh 9ch 9dh 9eh 9fh a0h ffh bank 1 dfh e0h adresh (2) adcon0 (2) eecon1 adresl (2) ansel (2) .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 9 pic12F629/675 table 2-1: special function registers summary address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod page bank 0 00h indf (1) addressing this location uses contents of fsr to address data memory 0000 0000 18,59 01h tmr0 timer0 module?s register xxxx xxxx 27 02h pcl program counter's (pc) least significant byte 0000 0000 17 03h status irp (2) rp1 (2) rp0 to pd z dc c 0001 1xxx 11 04h fsr indirect data memory address pointer xxxx xxxx 18 05h gpio ? ? gpio5 gpio4 gpio3 gpio2 gpio1 gpio0 --xx xxxx 19 06h ? unimplemented ? ? 07h ? unimplemented ? ? 08h ? unimplemented ? ? 09h ? unimplemented ? ? 0ah pclath ? ? ? write buffer for upper 5 bits of program counter ---0 0000 17 0bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 13 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 15 0dh ? unimplemented ? ? 0eh tmr1l holding register for the least significant byte of the 16-bit timer1 xxxx xxxx 30 0fh tmr1h holding register for the most significant byte of the 16-bit timer1 xxxx xxxx 30 10h t1con ? tmr1ge t1ckps1 t1ckps0 t1oscen t1sync tmr1cs tmr1on -000 0000 32 11h ? unimplemented ? ? 12h ? unimplemented ? ? 13h ? unimplemented ? ? 14h ? unimplemented ? ? 15h ? unimplemented ? ? 16h ? unimplemented ? ? 17h ? unimplemented ? ? 18h ? unimplemented ? ? 19h cmcon ? cout ? cinv cis cm2 cm1 cm0 -0-0 0000 35 1ah ? unimplemented ? ? 1bh ? unimplemented ? ? 1ch ? unimplemented ? ? 1dh ? unimplemented ? ? 1eh adresh (3) most significant 8 bits of the left shifted a/d result or 2 bits of the right shifted result xxxx xxxx 42 1fh adcon0 (3) adfm vcfg ? ? chs1 chs0 go/done adon 00-- 0000 43,59 legend: ? = unimplemented locations read as ?0?, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented note 1: this is not a physical register. 2: these bits are reserved and should always be maintained as ?0?. 3: pic12f675 only. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 10 ? 2003 microchip technology inc. bank 1 80h indf (1) addressing this location uses contents of fsr to address data memory 0000 0000 18,59 81h option_reg gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 12,28 82h pcl program counter's (pc) least significant byte 0000 0000 17 83h status irp (2) rp1 (2) rp0 to pd z dc c 0001 1xxx 11 84h fsr indirect data memory address pointer xxxx xxxx 18 85h trisio ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 --11 1111 19 86h ? unimplemented ? ? 87h ? unimplemented ? ? 88h ? unimplemented ? ? 89h ? unimplemented ? ? 8ah pclath ? ? ? write buffer for upper 5 bits of program counter ---0 0000 17 8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 13 8ch pie1 eeie adie ? ? cmie ? ? tmr1ie 00-- 0--0 14 8dh ? unimplemented ? ? 8eh pcon ? ? ? ? ? ? por bod ---- --0x 16 8fh ? unimplemented ? ? 90h osccal cal5 cal4 cal3 cal2 cal1 cal0 ? ? 1000 00-- 16 91h ? unimplemented ? ? 92h ? unimplemented ? ? 93h ? unimplemented ? ? 94h ? unimplemented ? ? 95h wpu ? ? wpu5 wpu4 ? wpu2 wpu1 wpu0 --11 -111 20 96h ioc ? ? ioc5 ioc4 ioc3 ioc2 ioc1 ioc0 --00 0000 21 97h ? unimplemented ? ? 98h ? unimplemented ? ? 99h vrcon vren ? vrr ? vr3 vr2 vr1 vr0 0-0- 0000 40 9ah eedata data eeprom data register 0000 0000 47 9bh eeadr ? data eeprom address register -000 0000 47 9ch eecon1 ? ? ? ? wrerr wren wr rd ---- x000 48 9dh eecon2 (1) eeprom control register 2 ---- ---- 48 9eh adresl (3) least significant 2 bits of the left shifted a/d result of 8 bits or the right shifted result xxxx xxxx 42 9fh ansel (3) ? adcs2 adcs1 adcs0 ans3 ans2 ans1 ans0 -000 1111 44,59 legend: ? = unimplemented locations read as ?0?, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented note 1: this is not a physical register. 2: these bits are reserved and should always be maintained as ?0?. 3: pic12f675 only. table 2-1: special function registers summary (continued) address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod page .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 11 pic12F629/675 2.2.2.1 status register the status register, shown in register 2-1, contains:  the arithmetic status of the alu  the reset status  the bank select bits for data memory (sram) the status register can be the destination for any instruction, like any other register. if the status register is the destination for an instruction that affects the z, dc or c bits, then the write to these three bits is disabled. these bits are set or cleared according to the device logic. furthermore, the to and pd bits are not writable. therefore, the result of an instruction with the status register as destination may be different than intended. for example, clrf status will clear the upper three bits and set the z bit. this leaves the status register as 000u u1uu (where u = unchanged). it is recommended, therefore, that only bcf, bsf, swapf and movwf instructions are used to alter the status register, because these instructions do not affect any status bits. for other instructions not affecting any status bits, see the ?instruction set summary?. register 2-1: status ? status register (address: 03h or 83h) note 1: bits irp and rp1 (status<7:6>) are not used by the pic12F629/675 and should be maintained as clear. use of these bits is not recommended, since this may affect upward compatibility with future products. 2: the c and dc bits operate as a borrow and digit borrow out bit, respectively, in subtraction. see the sublw and subwf instructions for examples. reserved reserved r/w-0 r-1 r-1 r/w-x r/w-x r/w-x irp rp1 rp0 to pd z dc c bit 7 bit 0 bit 7 irp: this bit is reserved and should be maintained as ?0? bit 6 rp1: this bit is reserved and should be maintained as ?0? bit 5 rp0: register bank select bit (used for direct addressing) 0 = bank 0 (00h - 7fh) 1 = bank 1 (80h - ffh) bit 4 to : time-out bit 1 = after power-up, clrwdt instruction, or sleep instruction 0 = a wdt time-out occurred bit 3 pd : power-down bit 1 = after power-up or by the clrwdt instruction 0 = by execution of the sleep instruction bit 2 z : zero bit 1 = the result of an arithmetic or logic operation is zero 0 = the result of an arithmetic or logic operation is not zero bit 1 dc : digit carry/borrow bit ( addwf , addlw,sublw,subwf instructions) for borrow, the polarity is reversed. 1 = a carry-out from the 4th low order bit of the result occurred 0 = no carry-out from the 4th low order bit of the result bit 0 c : carry/borrow bit ( addwf , addlw, sublw, subwf instructions) 1 = a carry-out from the most significant bit of the result occurred 0 = no carry-out from the most significant bit of the result occurred note: for borrow the polarity is reversed. a subtraction is executed by adding the two?s complement of the second operand. for rotate ( rrf , rlf ) instructions, this bit is loaded with either the high or low order bit of the source register legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 12 ? 2003 microchip technology inc. 2.2.2.2 option register the option register is a readable and writable register, which contains various control bits to configure:  tmr0/wdt prescaler  external gp2/int interrupt tmr0  weak pull-ups on gpio register 2-2: option_reg ? option register (address: 81h) note: to achieve a 1:1 prescaler assignment for tmr0, assign the prescaler to the wdt by setting psa bit to ?1? (option<3>). see section 4.4. r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 gppu intedg t0cs t0se psa ps2 ps1 ps0 bit 7 bit 0 bit 7 gppu : gpio pull-up enable bit 1 = gpio pull-ups are disabled 0 = gpio pull-ups are enabled by individual port latch values bit 6 intedg: interrupt edge select bit 1 = interrupt on rising edge of gp2/int pin 0 = interrupt on falling edge of gp2/int pin bit 5 t0cs: tmr0 clock source select bit 1 = transition on gp2/t0cki pin 0 = internal instruction cycle clock (clkout) bit 4 t0se: tmr0 source edge select bit 1 = increment on high-to-low transition on gp2/t0cki pin 0 = increment on low-to-high transition on gp2/t0cki pin bit 3 psa: prescaler assignment bit 1 = prescaler is assigned to the wdt 0 = prescaler is assigned to the timer0 module bit 2-0 ps2:ps0: prescaler rate select bits legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown 000 001 010 011 100 101 110 111 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 1 : 256 1 : 1 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 bit value tmr0 rate wdt rate .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 13 pic12F629/675 2.2.2.3 intcon register the intcon register is a readable and writable register, which contains the various enable and flag bits for tmr0 register overflow, gpio port change and external gp2/int pin interrupts. register 2-3: intcon ? interrupt control register (address: 0bh or 8bh) note: interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global enable bit, gie (intcon<7>). user soft- ware should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 gie peie t0ie inte gpie t0if intf gpif bit 7 bit 0 bit 7 gie: global interrupt enable bit 1 = enables all unmasked interrupts 0 = disables all interrupts bit 6 peie: peripheral interrupt enable bit 1 = enables all unmasked peripheral interrupts 0 = disables all peripheral interrupts bit 5 t0ie: tmr0 overflow interrupt enable bit 1 = enables the tmr0 interrupt 0 = disables the tmr0 interrupt bit 4 inte: gp2/int external interrupt enable bit 1 = enables the gp2/int external interrupt 0 = disables the gp2/int external interrupt bit 3 gpie: port change interrupt enable bit (1) 1 = enables the gpio port change interrupt 0 = disables the gpio port change interrupt bit 2 t0if: tmr0 overflow interrupt flag bit (2) 1 = tmr0 register has overflowed (must be cleared in software) 0 = tmr0 register did not overflow bit 1 intf: gp2/int external interrupt flag bit 1 = the gp2/int external interrupt occurred (must be cleared in software) 0 = the gp2/int external interrupt did not occur bit 0 gpif: port change interrupt flag bit 1 = when at least one of the gp5:gp0 pins changed state (must be cleared in software) 0 = none of the gp5:gp0 pins have changed state note 1: ioc register must also be enabled to enable an interrupt-on-change. 2: t0if bit is set when timer0 rolls over. timer0 is unchanged on reset and should be initialized before clearing t0if bit. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 14 ? 2003 microchip technology inc. 2.2.2.4 pie1 register the pie1 register contains the interrupt enable bits, as shown in register 2-4. register 2-4: pie1 ? peripheral interrupt enable register 1 (address: 8ch) note: bit peie (intcon<6>) must be set to enable any peripheral interrupt. r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 u-0 r/w-0 eeie adie ? ? cmie ? ? tmr1ie bit 7 bit 0 bit 7 eeie: ee write complete interrupt enable bit 1 = enables the ee write complete interrupt 0 = disables the ee write complete interrupt bit 6 adie: a/d converter interrupt enable bit (pic12f675 only) 1 = enables the a/d converter interrupt 0 = disables the a/d converter interrupt bit 5-4 unimplemented: read as ?0? bit 3 cmie: comparator interrupt enable bit 1 = enables the comparator interrupt 0 = disables the comparator interrupt bit 2-1 unimplemented: read as ?0? bit 0 tmr1ie: tmr1 overflow interrupt enable bit 1 = enables the tmr1 overflow interrupt 0 = disables the tmr1 overflow interrupt legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 15 pic12F629/675 2.2.2.5 pir1 register the pir1 register contains the interrupt flag bits, as shown in register 2-5. register 2-5: pir1 ? peripheral interrupt register 1 (address: 0ch) note: interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global enable bit, gie (intcon<7>). user software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 u-0 r/w-0 eeif adif ? ? cmif ? ? tmr1if bit 7 bit 0 bit 7 eeif: eeprom write operation interrupt flag bit 1 = the write operation completed (must be cleared in software) 0 = the write operation has not completed or has not been started bit 6 adif: a/d converter interrupt flag bit (pic12f675 only) 1 = the a/d conversion is complete (must be cleared in software) 0 = the a/d conversion is not complete bit 5-4 unimplemented : read as ?0? bit 3 cmif : comparator interrupt flag bit 1 = comparator input has changed (must be cleared in software) 0 = comparator input has not changed bit 2-1 unimplemented : read as ?0? bit 0 tmr1if : tmr1 overflow interrupt flag bit 1 = tmr1 register overflowed (must be cleared in software) 0 = tmr1 register did not overflow legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 16 ? 2003 microchip technology inc. 2.2.2.6 pcon register the power control (pcon) register contains flag bits to differentiate between a:  power-on reset (por)  brown-out detect (bod)  watchdog timer reset (wdt)  external mclr reset the pcon register bits are shown in register 2-6. register 2-6: pcon ? power control register (address: 8eh) 2.2.2.7 osccal register the oscillator calibration register (osccal) is used to calibrate the internal 4 mhz oscillator. it contains 6 bits to adjust the frequency up or down to achieve 4 mhz. the osccal register bits are shown in register 2-7. register 2-7: osccal ? oscillator calibration register (address: 90h) u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-x ? ? ? ? ? ? por bod bit 7 bit 0 bit 7-2 unimplemented: read as '0' bit 1 por : power-on reset status bit 1 = no power-on reset occurred 0 = a power-on reset occurred (must be set in software after a power-on reset occurs) bit 0 bod : brown-out detect status bit 1 = no brown-out detect occurred 0 = a brown-out detect occurred (must be set in software after a brown-out detect occurs) legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 cal5 cal4 cal3 cal2 cal1 cal0 ? ? bit 7 bit 0 bit 7-2 cal5:cal0: 6-bit signed oscillator calibration bits 111111 = maximum frequency 100000 = center frequency 000000 = minimum frequency bit 1-0 unimplemented: read as '0' legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 17 pic12F629/675 2.3 pcl and pclath the program counter (pc) is 13-bits wide. the low byte comes from the pcl register, which is a readable and writable register. the high byte (pc<12:8>) is not directly readable or writable and comes from pclath. on any reset, the pc is cleared. figure 2-3 shows the two situations for the loading of the pc. the upper example in figure 2-3 shows how the pc is loaded on a write to pcl (pclath<4:0> pch). the lower example in figure 2-3 shows how the pc is loaded during a call or goto instruction (pclath<4:3> pch). figure 2-3: loading of pc in different situations 2.3.1 computed goto a computed goto is accomplished by adding an offset to the program counter ( addwf pcl ). when perform- ing a table read using a computed goto method, care should be exercised if the table location crosses a pcl memory boundary (each 256-byte block). refer to the application note ?implementing a table read" (an556). 2.3.2 stack the pic12F629/675 family has an 8-level deep x 13-bit wide hardware stack (see figure 2-1). the stack space is not part of either program or data space and the stack pointer is not readable or writable. the pc is pushed onto the stack when a call instruction is executed, or an interrupt causes a branch. the stack is poped in the event of a return, retlw or a retfie instruction execution. pclath is not affected by a push or pop operation. the stack operates as a circular buffer. this means that after the stack has been pushed eight times, the ninth push overwrites the value that was stored from the first push. the tenth push overwrites the second push (and so on). pc 12 8 7 0 5 pclath<4:0> pclath instruction with alu result goto, call opcode <10:0> 8 pc 12 11 10 0 11 pclath<4:3> pch pcl 87 2 pclath pch pcl pcl as destination note 1: there are no status bits to indicate stack overflow or stack underflow conditions. 2: there are no instructions/mnemonics called push or pop. these are actions that occur from the execution of the call, return, retlw and retfie instructions, or the vectoring to an interrupt address. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 18 ? 2003 microchip technology inc. 2.4 indirect addressing, indf and fsr registers the indf register is not a physical register. addressing the indf register will cause indirect addressing. indirect addressing is possible by using the indf register. any instruction using the indf register actu- ally accesses data pointed to by the file select register (fsr). reading indf itself indirectly will produce 00h. writing to the indf register indirectly results in a no operation (although status bits may be affected). an effective 9-bit address is obtained by concatenating the 8-bit fsr register and the irp bit (status<7>), as shown in figure 2-4. a simple program to clear ram location 20h-2fh using indirect addressing is shown in example 2-1. example 2-1: indirect addressing figure 2-4: direct/indirect addressing pic12F629/675 movlw 0x20 ;initialize pointer movwf fsr ;to ram next clrf indf ;clear indf register incf fsr ;inc pointer btfss fsr,4 ;all done? goto next ;no clear next continue ;yes continue for memory map detail see figure 2-2. note 1: the rp1 and irp bits are reserved; always maintain these bits clear. data memory indirect addressing direct addressing bank select location select rp1 (1) rp0 6 0 from opcode irp (1) fsr register 7 0 bank select location select 00 01 10 11 180h 1ffh 00h 7fh bank 0 bank 1 bank 2 bank 3 not used .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 19 pic12F629/675 3.0 gpio port there are as many as six general purpose i/o pins available. depending on which peripherals are enabled, some or all of the pins may not be available as general purpose i/o. in general, when a peripheral is enabled, the associated pin may not be used as a general purpose i/o pin. 3.1 gpio and the trisio registers gpio is an 6-bit wide, bi-directional port. the corre- sponding data direction register is trisio. setting a trisio bit (= 1) will make the corresponding gpio pin an input (i.e., put the corresponding output driver in a hi-impedance mode). clearing a trisio bit (= 0) will make the corresponding gpio pin an output (i.e., put the contents of the output latch on the selected pin). the exception is gp3, which is input only and its trisio bit will always read as ?1?. example 3-1 shows how to initialize gpio. reading the gpio register reads the status of the pins, whereas writing to it will write to the port latch. all write operations are read-modify-write operations. there- fore, a write to a port implies that the port pins are read, this value is modified, and then written to the port data latch. gp3 reads ?0? when mclren = 1. the trisio register controls the direction of the gp pins, even when they are being used as analog inputs. the user must ensure the bits in the trisio register are maintained set when using them as analog inputs. i/o pins configured as analog inputs always read ?0?. example 3-1: initializing gpio 3.2 additional pin functions every gpio pin on the pic12F629/675 has an interrupt-on-change option and every gpio pin, except gp3, has a weak pull-up option. the next two sections describe these functions. 3.2.1 weak pull-up each of the gpio pins, except gp3, has an individually configurable weak internal pull-up. control bits wpux enable or disable each pull-up. refer to register 3-3. each weak pull-up is automatically turned off when the port pin is configured as an output. the pull-ups are disabled on a power-on reset by the gppu bit (option<7>). register 3-1: gpio ? gpio register (address: 05h) note: additional information on i/o ports may be found in the picmicro? mid-range refer- ence manual, (ds33023) note: the ansel (9fh) and cmcon (19h) registers (9fh) must be initialized to configure an analog channel as a digital input. pins configured as analog inputs will read ?0?. the ansel register is defined for the pic12f675. bcf status,rp0 ;bank 0 clrf gpio ;init gpio movlw 07h ;set gp<2:0> to movwf cmcon ;digital io bsf status,rp0 ;bank 1 clrf ansel ;digital i/o movlw 0ch ;set gp<3:2> as inputs movwf trisio ;and set gp<5:4,1:0> ;as outputs u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x ? ? gpio5 gpio4 gpio3 gpio2 gpio1 gpio0 bit 7 bit 0 bit 7-6: unimplemented : read as ?0? bit 5-0: gpio<5:0> : general purpose i/o pin. 1 = port pin is >v ih 0 = port pin is pic12F629/675 ds41190c-page 20 ? 2003 microchip technology inc. register 3-2: trisio ? gpio tristate register (address: 85h) register 3-3: wpu ? weak pull-up register (address: 95h) u-0 u-0 r/w-x r/w-x r-1 r/w-x r/w-x r/w-x ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 bit 7 bit 0 bit 7-6: unimplemented : read as ?0? bit 5-0: trisio<5:0> : general purpose i/o tri-state control bit 1 = gpio pin configured as an input (tri-stated) 0 = gpio pin configured as an output. note: trisio<3> always reads 1. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown u-0 u-0 r/w-1 r/w-1 u-0 r/w-1 r/w-1 r/w-1 ? ? wpu5 wpu4 ? wpu2 wpu1 wpu0 bit 7 bit 0 bit 7-6 unimplemented: read as ?0? bit 5-4 wpu<5:4>: weak pull-up register bit 1 = pull-up enabled 0 = pull-up disabled bit 3 unimplemented: read as ?0? bit 2-0 wpu<2:0>: weak pull-up register bit 1 = pull-up enabled 0 = pull-up disabled note 1: global gppu must be enabled for individual pull-ups to be enabled. 2: the weak pull-up device is automatically disabled if the pin is in output mode (trisio = 0). legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 21 pic12F629/675 3.2.2 interrupt-on-change each of the gpio pins is individually configurable as an interrupt-on-change pin. control bits ioc enable or disable the interrupt function for each pin. refer to register 3-4. the interrupt-on-change is disabled on a power-on reset. for enabled interrupt-on-change pins, the values are compared with the old value latched on the last read of gpio. the ?mismatch? outputs of the last read are or'd together to set, the gp port change interrupt flag bit (gpif) in the intcon register. this interrupt can wake the device from sleep. the user, in the interrupt service routine, can clear the interrupt in the following manner: a) any read or write of gpio. this will end the mismatch condition. b) clear the flag bit gpif. a mismatch condition will continue to set flag bit gpif. reading gpio will end the mismatch condition and allow flag bit gpif to be cleared. register 3-4: ioc ? interrupt-on-change gpio register (address: 96h) note: if a change on the i/o pin should occur when the read operation is being executed (start of the q2 cycle), then the gpif inter- rupt flag may not get set. u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ioc5 ioc4 ioc3 ioc2 ioc1 ioc0 bit 7 bit 0 bit 7-6 unimplemented: read as ?0? bit 5-0 ioc<5:0>: interrupt-on-change gpio control bit 1 = interrupt-on-change enabled 0 = interrupt-on-change disabled note 1: global interrupt enable (gie) must be enabled for individual interrupts to be recognized. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 22 ? 2003 microchip technology inc. 3.3 pin descriptions and diagrams each gpio pin is multiplexed with other functions. the pins and their combined functions are briefly described here. for specific information about individual functions such as the comparator or the a/d, refer to the appropriate section in this data sheet. 3.3.1 gp0/an0/cin+ figure 3-1 shows the diagram for this pin. the gp0 pin is configurable to function as one of the following:  a general purpose i/o  an analog input for the a/d (pic12f675 only)  an analog input to the comparator 3.3.2 gp1/an1/cin-/v ref figure 3-1 shows the diagram for this pin. the gp1 pin is configurable to function as one of the following:  as a general purpose i/o  an analog input for the a/d (pic12f675 only)  an analog input to the comparator  a voltage reference input for the a/d (pic12f675 only) figure 3-1: block diagram of gp0 and gp1 pins i/o pin v dd v ss d q ck q d q ck q d q ck q d q ck q v dd d en q d en q weak data bus wr wpu rd wpu rd port rd port wr port wr trisio rd trisio wr ioc rd ioc interrupt-on-change to comparator to a/d converter analog input mode gppu analog input mode .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 23 pic12F629/675 3.3.3 gp2/an2/t0cki/int/cout figure 3-2 shows the diagram for this pin. the gp2 pin is configurable to function as one of the following:  a general purpose i/o  an analog input for the a/d (pic12f675 only)  the clock input for tmr0  an external edge triggered interrupt  a digital output from the comparator figure 3-2: block diagram of gp2 3.3.4 gp3/mclr /v pp figure 3-3 shows the diagram for this pin. the gp3 pin is configurable to function as one of the following:  a general purpose input  as master clear reset figure 3-3: block diagram of gp3 i/o pin v dd v ss d q ck q d q ck q d q ck q d q ck q v dd d en q d en q weak analog input mode data bus wr wpu rd wpu rd port wr port wr trisio rd trisio wr ioc rd ioc interrupt-on-change to a/d converter 0 1 cout cout enable to i n t to tmr0 analog input mode gppu rd port analog input mode i/o pin v ss d q ck q d en q data bus rd port rd port wr ioc rd ioc interrupt-on-change reset mclre rd trisio v ss d en q mclre .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 24 ? 2003 microchip technology inc. 3.3.5 gp4/an3/t1g /osc2/clkout figure 3-4 shows the diagram for this pin. the gp4 pin is configurable to function as one of the following:  a general purpose i/o  an analog input for the a/d (pic12f675 only)  a tmr1 gate input  a crystal/resonator connection  a clock output figure 3-4: block diagram of gp4 3.3.6 gp5/t1cki/osc1/clkin figure 3-5 shows the diagram for this pin. the gp5 pin is configurable to function as one of the following:  a general purpose i/o  a tmr1 clock input  a crystal/resonator connection  a clock input figure 3-5: block diagram of gp5 i/o pin v dd v ss d q ck q d q ck q d q ck q d q ck q v dd d en q d en q weak analog input mode data bus wr wpu rd wpu rd port wr port wr trisio rd trisio wr ioc rd ioc interrupt-on-change f osc /4 to a/d converter oscillator circuit osc1 clkout 0 1 clkout enable enable analog input mode gppu rd port to tmr1 t1g intosc/ rc/ec (2) clk modes (1) clkout enable note 1: clk modes are xt, hs, lp, lptmr1 and clkout enable. 2: with clkout option. i/o pin v dd v ss d q ck q d q ck q d q ck q d q ck q v dd d en q d en q weak data bus wr wpu rd wpu rd port wr port wr trisio rd trisio wr ioc rd ioc interrupt-on-change to tmr1 or clkgen intosc mode rd port intosc mode gppu oscillator circuit osc2 note 1: timer1 lp oscillator enabled 2: when using timer1 with lp oscillator, the schmitt trigger is by-passed. (2) tmr1lpen (1) .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 25 pic12F629/675 table 3-1: summary of registers associated with gpio address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on: por, bod value on all other resets 05h gpio ? ? gp5 gp4 gp3 gp2 gp1 gp0 --xx xxxx --uu uuuu 0bh/8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 19h cmcon ? cout ? cinv cis cm2 cm1 cm0 -0-0 0000 -0-0 0000 81h option_reg gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 85h trisio ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 --11 1111 --11 1111 95h wpu ? ? wpu5 wpu4 ? wpu2 wpu1 wpu0 --11 -111 --11 -111 96h ioc ? ? ioc5 ioc4 ioc3 ioc2 ioc1 ioc0 --00 0000 --00 0000 9fh ansel ? adcs2 adcs1 adcs0 ans3 ans2 ans1 ans0 -000 1111 -000 1111 legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. shaded cells are not used by gpio. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 26 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 27 pic12F629/675 4.0 timer0 module the timer0 module timer/counter has the following features:  8-bit timer/counter  readable and writable  8-bit software programmable prescaler  internal or external clock select  interrupt on overflow from ffh to 00h  edge select for external clock figure 4-1 is a block diagram of the timer0 module and the prescaler shared with the wdt. 4.1 timer0 operation timer mode is selected by clearing the t0cs bit (option_reg<5>). in timer mode, the timer0 module will increment every instruction cycle (without prescaler). if tmr0 is written, the increment is inhibited for the following two instruction cycles. the user can work around this by writing an adjusted value to the tmr0 register. counter mode is selected by setting the t0cs bit (option_reg<5>). in this mode, the timer0 module will increment either on every rising or falling edge of pin gp2/t0cki. the incrementing edge is determined by the source edge (t0se) control bit (option_reg<4>). clearing the t0se bit selects the rising edge. 4.2 timer0 interrupt a timer0 interrupt is generated when the tmr0 register timer/counter overflows from ffh to 00h. this overflow sets the t0if bit. the interrupt can be masked by clearing the t0ie bit (intcon<5>). the t0if bit (intcon<2>) must be cleared in software by the timer0 module interrupt service routine before re- enabling this interrupt. the timer0 interrupt cannot wake the processor from sleep since the timer is shut-off during sleep. figure 4-1: block diagram of the timer0/wdt prescaler note: additional information on the timer0 module is available in the picmicro tm mid- range reference manual, (ds33023). note: counter mode has specific external clock requirements. additional information on these requirements is available in the picmicro tm mid-range reference manual, (ds33023). t0cki t0se pin clkout tmr0 watchdog timer wdt time-out ps0 - ps2 wdte data bus set flag bit t0if on overflow t0cs note 1: t0se, t0cs, psa, ps0-ps2 are bits in the option register. 0 1 0 1 0 1 sync 2 cycles 8 8 8-bit prescaler 0 1 (= f osc /4) psa psa psa .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 28 ? 2003 microchip technology inc. 4.3 using timer0 with an external clock when no prescaler is used, the external clock input is the same as the prescaler output. the synchronization of t0cki, with the internal phase clocks, is accom- plished by sampling the prescaler output on the q2 and q4 cycles of the internal phase clocks. therefore, it is necessary for t0cki to be high for at least 2t osc (and a small rc delay of 20 ns) and low for at least 2t osc (and a small rc delay of 20 ns). refer to the electrical specification of the desired device. register 4-1: option_reg ? option register (address: 81h) note: the ansel (9fh) and cmcon (19h) registers must be initialized to configure an analog channel as a digital input. pins configured as analog inputs will read ?0?. the ansel register is defined for the pic12f675. r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 gppu intedg t0cs t0se psa ps2 ps1 ps0 bit 7 bit 0 bit 7 gppu : gpio pull-up enable bit 1 = gpio pull-ups are disabled 0 = gpio pull-ups are enabled by individual port latch values bit 6 intedg: interrupt edge select bit 1 = interrupt on rising edge of gp2/int pin 0 = interrupt on falling edge of gp2/int pin bit 5 t0cs: tmr0 clock source select bit 1 = transition on gp2/t0cki pin 0 = internal instruction cycle clock (clkout) bit 4 t0se: tmr0 source edge select bit 1 = increment on high-to-low transition on gp2/t0cki pin 0 = increment on low-to-high transition on gp2/t0cki pin bit 3 psa: prescaler assignment bit 1 = prescaler is assigned to the wdt 0 = prescaler is assigned to the timer0 module bit 2-0 ps2:ps0: prescaler rate select bits legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown 000 001 010 011 100 101 110 111 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 1 : 256 1 : 1 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 bit value tmr0 rate wdt rate .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 29 pic12F629/675 4.4 prescaler an 8-bit counter is available as a prescaler for the timer0 module, or as a postscaler for the watchdog timer. for simplicity, this counter will be referred to as ?prescaler? throughout this data sheet. the prescaler assignment is controlled in software by the control bit psa (option_reg<3>). clearing the psa bit will assign the prescaler to timer0. prescale values are selectable via the ps2:ps0 bits (option_reg<2:0>). the prescaler is not readable or writable. when assigned to the timer0 module, all instructions writing to the tmr0 register (e.g., clrf 1, movwf 1, bsf 1, x....etc. ) will clear the prescaler. when assigned to wdt, a clrwdt instruction will clear the prescaler along with the watchdog timer. 4.4.1 switching prescaler assignment the prescaler assignment is fully under software control (i.e., it can be changed ?on the fly? during program execution). to avoid an unintended device reset, the following instruction sequence (example 4-1) must be executed when changing the prescaler assignment from timer0 to wdt. example 4-1: changing prescaler (timer0 wdt) to change prescaler from the wdt to the tmr0 module, use the sequence shown in example 4-2. this precaution must be taken even if the wdt is disabled. example 4-2: changing prescaler (wdt timer0) table 4-1: registers associated with timer0 bcf status,rp0 ;bank 0 clrwdt ;clear wdt clrf tmr0 ;clear tmr0 and ; prescaler bsf status,rp0 ;bank 1 movlw b?00101111? ;required if desired movwf option_reg ; ps2:ps0 is clrwdt ; 000 or 001 ; movlw b?00101xxx? ;set postscaler to movwf option_reg ; desired wdt rate bcf status,rp0 ;bank 0 clrwdt ;clear wdt and ; postscaler bsf status,rp0 ;bank 1 movlw b?xxxx0xxx? ;select tmr0, ; prescale, and ; clock source movwf option_reg ; bcf status,rp0 ;bank 0 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 01h tmr0 timer0 module register xxxx xxxx uuuu uuuu 0bh/8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 81h option_reg gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 85h trisio ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 --11 1111 --11 1111 legend: ? = unimplemented locations, read as ?0?, u = unchanged, x = unknown. shaded cells are not used by the timer0 module. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 30 ? 2003 microchip technology inc. 5.0 timer1 module with gate control the pic12F629/675 devices have a 16-bit timer. figure 5-1 shows the basic block diagram of the timer1 module. timer1 has the following features:  16-bit timer/counter (tmr1h:tmr1l)  readable and writable  internal or external clock selection  synchronous or asynchronous operation  interrupt on overflow from ffffh to 0000h  wake-up upon overflow (asynchronous mode)  optional external enable input (t1g )  optional lp oscillator the timer1 control register (t1con), shown in register 5-1, is used to enable/disable timer1 and select the various features of the timer1 module. figure 5-1: timer1 block diagram note: additional information on timer modules is available in the picmicro tm mid-range reference manual, (ds33023). tmr1h tmr1l lp oscillator t1sync tmr1cs t1ckps<1:0> sleep input f osc /4 internal clock prescaler 1, 2, 4, 8 synchronize detect 1 0 0 1 synchronized clock input 2 osc1 osc2 set flag bit tmr1if on overflow tmr1 tmr1on tmr1ge tmr1on tmr1ge intosc t1oscen lp w/o clkout t1g .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 31 pic12F629/675 5.1 timer1 modes of operation timer1 can operate in one of three modes:  16-bit timer with prescaler  16-bit synchronous counter  16-bit asynchronous counter in timer mode, timer1 is incremented on every instruction cycle. in counter mode, timer1 is incre- mented on the rising edge of the external clock input t1cki. in addition, the counter mode clock can be synchronized to the microcontroller system clock or run asynchronously. in counter and timer modules, the counter/timer clock can be gated by the t1g input. if an external clock oscillator is needed (and the microcontroller is using the intosc w/o clkout), timer1 can use the lp oscillator as a clock source. 5.2 timer1 interrupt the timer1 register pair (tmr1h:tmr1l) increments to ffffh and rolls over to 0000h. when timer1 rolls over, the timer1 interrupt flag bit (pir1<0>) is set. to enable the interrupt on rollover, you must set these bits:  timer1 interrupt enable bit (pie1<0>)  peie bit (intcon<6>)  gie bit (intcon<7>). the interrupt is cleared by clearing the tmr1if in the interrupt service routine. 5.3 timer1 prescaler timer1 has four prescaler options allowing 1, 2, 4, or 8 divisions of the clock input. the t1ckps bits (t1con<5:4>) control the prescale counter. the prescale counter is not directly readable or writable; however, the prescaler counter is cleared upon a write to tmr1h or tmr1l. figure 5-2: timer1 incrementing edge note: in counter mode, a falling edge must be registered by the counter prior to the first incrementing rising edge. note: the tmr1h:ttmr1l register pair and the tmr1if bit should be cleared before enabling interrupts. t1cki = 1 when tmr1 enabled t1cki = 0 when tmr1 enabled note 1: arrows indicate counter increments. 2: in counter mode, a falling edge must be registered by the counter prior to the first incrementing rising edge of the clock. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 32 ? 2003 microchip technology inc. register 5-1: t1con ? timer1 control register (address: 10h) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? tmr1ge t1ckps1 t1ckps0 t1oscen t1sync tmr1cs tmr1on bit 7 bit 0 bit 7 unimplemented: read as ?0? bit 6 tmr1ge: timer1 gate enable bit if tmr1on = 0: this bit is ignored if tmr1on = 1: 1 = timer1 is on if t1g pin is low 0 = timer1 is on bit 5-4 t1ckps1:t1ckps0: timer1 input clock prescale select bits 11 = 1:8 prescale value 10 = 1:4 prescale value 01 = 1:2 prescale value 00 = 1:1 prescale value bit 3 t1oscen: lp oscillator enable control bit if intosc without clkout oscillator is active: 1 = lp oscillator is enabled for timer1 clock 0 = lp oscillator is off else: this bit is ignored bit 2 t1sync : timer1 external clock input synchronization control bit tmr1cs = 1: 1 = do not synchronize external clock input 0 = synchronize external clock input tmr1cs = 0: this bit is ignored. timer1 uses the internal clock. bit 1 tmr1cs: timer1 clock source select bit 1 = external clock from t1oso/t1cki pin (on the rising edge) 0 = internal clock (f osc /4) bit 0 tmr1on: timer1 on bit 1 = enables timer1 0 = stops timer1 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 33 pic12F629/675 5.4 timer1 operation in asynchronous counter mode if control bit t1sync (t1con<2>) is set, the external clock input is not synchronized. the timer continues to increment asynchronous to the internal phase clocks. the timer will continue to run during sleep and can generate an interrupt on overflow, which will wake-up the processor. however, special precautions in software are needed to read/write the timer (section 5.4.1). 5.4.1 reading and writing timer1 in asynchronous counter mode reading tmr1h or tmr1l, while the timer is running from an external asynchronous clock, will ensure a valid read (taken care of in hardware). however, the user should keep in mind that reading the 16-bit timer in two 8-bit values itself, poses certain problems, since the timer may overflow between the reads. for writes, it is recommended that the user simply stop the timer and write the desired values. a write conten- tion may occur by writing to the timer registers, while the register is incrementing. this may produce an unpredictable value in the timer register. reading the 16-bit value requires some care. examples 12-2 and 12-3 in the picmicro? mid-range mcu family reference manual (ds33023) show how to read and write timer1 when it is running in asynchronous mode. 5.5 timer1 oscillator a crystal oscillator circuit is built-in between pins osc1 (input) and osc2 (amplifier output). it is enabled by setting control bit t1oscen (t1con<3>). the oscillator is a low power oscillator rated up to 37 khz. it will continue to run during sleep. it is primarily intended for a 32 khz crystal. table 9-2 shows the capacitor selection for the timer1 oscillator. the timer1 oscillator is shared with the system lp oscillator. thus, timer1 can use this mode only when the system clock is derived from the internal oscillator. as with the system lp oscillator, the user must provide a software time delay to ensure proper oscillator start-up while enabled, trisio4 and trisio5 are set. gp4 and gp5 read ?0? and trisio4 and trisio5 are read ?1?. 5.6 timer1 operation during sleep timer1 can only operate during sleep when setup in asynchronous counter mode. in this mode, an external crystal or clock source can be used to increment the counter. to setup the timer to wake the device:  timer1 must be on (t1con<0>)  tmr1ie bit (pie1<0>) must be set  peie bit (intcon<6>) must be set the device will wake-up on an overflow. if the gie bit (intcon<7>) is set, the device will wake-up and jump to the interrupt service routine on an overflow. table 5-1: registers associated with timer1 as a timer/counter note: the ansel (9fh) and cmcon (19h) registers must be initialized to configure an analog channel as a digital input. pins configured as analog inputs will read ?0?. the ansel register is defined for the pic12f675. note: the oscillator requires a start-up and stabi- lization time before use. thus, t1oscen should be set and a suitable delay observed prior to enabling timer1. address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 0bh/8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 00-- 0--0 0eh tmr1l holding register for the least significant byte of the 16-bit tmr1 register xxxx xxxx uuuu uuuu 0fh tmr1h holding register for the most significant byte of the 16-bit tmr1 register xxxx xxxx uuuu uuuu 10h t1con ? tmr1ge t1ckps1 t1ckps0 t1oscen t1sync tmr1cs tmr1on -000 0000 -uuu uuuu 8ch pie1 eeie adie ? ? cmie ? ? tmr1ie 00-- 0--0 00-- 0--0 legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. shaded cells are not used by the timer1 module. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 34 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 35 pic12F629/675 6.0 comparator module the pic12F629/675 devices have one analog comparator. the inputs to the comparator are multiplexed with the gp0 and gp1 pins. there is an on-chip comparator voltage reference that can also be applied to an input of the comparator. in addition, gp2 can be configured as the comparator output. the comparator control register (cmcon), shown in register 6-1, contains the bits to control the comparator. register 6-1: cmcon ? comparator control register (address: 19h) u-0 r-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? cout ? cinv cis cm2 cm1 cm0 bit 7 bit 0 bit 7 unimplemented : read as ?0? bit 6 cout : comparator output bit when c i nv = 0: 1 = v in + > v in - 0 = v in + < v in - when c i nv = 1: 1 = v in + < v in - 0 = v in + > v in - bit 5 unimplemented : read as ?0? bit 4 cinv : comparator output inversion bit 1 = output inverted 0 = output not inverted bit 3 cis : comparator input switch bit when cm2:cm0 = 110 or 101: 1 = v in - connects to cin+ 0 = v in - connects to cin- bit 2-0 cm2:cm0 : comparator mode bits figure 6-2 shows the comparator modes and cm2:cm0 bit settings legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 36 ? 2003 microchip technology inc. 6.1 comparator operation a single comparator is shown in figure 6-1, along with the relationship between the analog input levels and the digital output. when the analog input at v in + is less than the analog input v in -, the output of the comparator is a digital low level. when the analog input at v in + is greater than the analog input v in -, the output of the comparator is a digital high level. the shaded areas of the output of the comparator in figure 6-1 represent the uncertainty due to input offsets and response time. the polarity of the comparator output can be inverted by setting the cinv bit (cmcon<4>). clearing cinv results in a non-inverted output. a complete table showing the output state versus input conditions and the polarity bit is shown in table 6-1. table 6-1: output state vs. input conditions figure 6-1: single comparator note: to use cin+ and cin- pins as analog inputs, the appropriate bits must be programmed in the cmcon (19h) register. input conditions cinv cout v in - > v in + 0 0 v in - < v in + 0 1 v in - > v in + 1 1 v in - < v in + 1 0 output v in - v in + output + ? v in + v in - note: cinv bit (cmcon<4>) is clear. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 37 pic12F629/675 6.2 comparator configuration there are eight modes of operation for the comparator. the cmcon register, shown in register 6-1, is used to select the mode. figure 6-2 shows the eight possible modes. the trisio register controls the data direction of the comparator pins for each mode. if the comparator mode is changed, the comparator output level may not be valid for a specified period of time. refer to the specifications in section 12.0. figure 6-2: comparator i/o operating modes note: comparator interrupts should be disabled during a comparator mode change. other- wise, a false interrupt may occur. comparator reset (por default value - low power) comparator off (lowest power) cm2:cm0 = 000 cm2:cm0 = 111 comparator without output comparator w/o output and with internal reference cm2:cm0 = 010 cm2:cm0 = 100 comparator with output and internal reference multiplexed input with internal reference and output cm2:cm0 = 011 cm2:cm0 = 101 comparator with output multiplexed input with internal reference cm2:cm0 = 001 cm2:cm0 = 110 a = analog input, ports always reads ?0? d = digital input cis = comparator input switch (cmcon<3>) gp1/cin- gp0/cin+ off (read as '0') a a gp2/cout d gp1/cin- gp0/cin+ off (read as '0') d d gp2/cout d gp1/cin- gp0/cin+ cout a a gp2/cout d gp1/cin- gp0/cin+ cout a d gp2/cout d from cv ref module gp1/cin- gp0/cin+ cout a d gp2/cout d from cv ref module gp1/cin- gp0/cin+ cout a a gp2/cout d from cv ref module cis = 0 cis = 1 gp1/cin- gp0/cin+ cout a a gp2/cout d gp1/cin- gp0/cin+ cout a a gp2/cout d from cv ref module cis = 0 cis = 1 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 38 ? 2003 microchip technology inc. 6.3 analog input connection considerations a simplified circuit for an analog input is shown in figure 6-3. since the analog pins are connected to a digital output, they have reverse biased diodes to v dd and v ss . the analog input, therefore, must be between v ss and v dd . if the input voltage deviates from this range by more than 0.6v in either direction, one of the diodes is forward biased and a latchup may occur. a maximum source impedance of 10 k ? is recommended for the analog sources. any external component connected to an analog input pin, such as a capacitor or a zener diode, should have very little leakage current. figure 6-3: analog input mode 6.4 comparator output the comparator output, cout, is read through the cmcon register. this bit is read only. the comparator output may also be directly output to the gp2 pin in three of the eight possible modes, as shown in figure 6-2. when in one of these modes, the output on gp2 is asynchronous to the internal clock. figure 6-4 shows the comparator output block diagram. the trisio<2> bit functions as an output enable/ disable for the gp2 pin while the comparator is in an output mode. figure 6-4: modified comparator output block diagram va rs < 10k a in c pin 5 pf v dd v t = 0.6v v t = 0.6v r ic leakage 500 na vss legend: c pin = input capacitance v t = threshold voltage i leakage = leakage current at the pin due to various junctions r ic = interconnect resistance r s = source impedance va = analog voltage note 1: when reading the gpio register, all pins configured as analog inputs will read as a ?0?. pins configured as digital inputs will convert an analog input according to the ttl input specification. 2: analog levels on any pin that is defined as a digital input, may cause the input buffer to consume more current than is specified. to gp2/t0cki pin rd cmcon set cmif bit reset to data bus cinv cv ref d en q d en q rd cmcon gp1/cin- gp0/cin+ cm2:cm0 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 39 pic12F629/675 6.5 comparator reference the comparator module also allows the selection of an internally generated voltage reference for one of the comparator inputs. the internal reference signal is used for four of the eight comparator modes. the vrcon register, register 6-2, controls the voltage reference module shown in figure 6-5. 6.5.1 configuring the voltage reference the voltage reference can output 32 distinct voltage levels, 16 in a high range and 16 in a low range. the following equations determine the output voltages: 6.5.2 voltage reference accuracy/error the full range of v ss to v dd cannot be realized due to the construction of the module. the transistors on the top and bottom of the resistor ladder network (figure 6-5) keep cv ref from approaching v ss or v dd . the voltage reference is v dd derived and there- fore, the cv ref output changes with fluctuations in v dd . the tested absolute accuracy of the comparator voltage reference can be found in section 12.0. figure 6-5: comparator voltage reference block diagram 6.6 comparator response time response time is the minimum time, after selecting a new reference voltage or input source, before the comparator output is ensured to have a valid level. if the internal reference is changed, the maximum delay of the internal voltage reference must be considered when using the comparator outputs. otherwise, the maximum delay of the comparators should be used (table 12-7). 6.7 operation during sleep both the comparator and voltage reference, if enabled before entering sleep mode, remain active during sleep. this results in higher sleep currents than shown in the power-down specifications. the additional current consumed by the comparator and the voltage reference is shown separately in the specifica- tions. to minimize power consumption while in sleep mode, turn off the comparator, cm2:cm0 = 111 , and voltage reference, vrcon<7> = 0. while the comparator is enabled during sleep, an interrupt will wake-up the device. if the device wakes up from sleep, the contents of the cmcon and vrcon registers are not affected. 6.8 effects of a reset a device reset forces the cmcon and vrcon registers to their reset states. this forces the com- parator module to be in the comparator reset mode, cm2:cm0 = 000 and the voltage reference to its off state. thus, all potential inputs are analog inputs with the comparator and voltage reference disabled to consume the smallest current possible. vrr = 1 (low range): cv ref = (vr3:vr0 / 24) x v dd vrr = 0 (high range): cv ref = (v dd / 4) + (vr3:vr0 x v dd / 32) vrr 8r vr3:vr0 16-1 analog 8r r r r r cv ref to 16 stages comparator input vren v dd mux .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 40 ? 2003 microchip technology inc. register 6-2: vrcon ? voltage reference control register (address: 99h) 6.9 comparator interrupts the comparator interrupt flag is set whenever there is a change in the output value of the comparator. software will need to maintain information about the status of the output bits, as read from cmcon<6>, to determine the actual change that has occurred. the cmif bit, pir1<3>, is the comparator interrupt flag. this bit must be reset in software by clearing it to ?0?. since it is also possible to write a '1' to this register, a simulated interrupt may be initiated. the cmie bit (pie1<3>) and the peie bit (intcon<6>) must be set to enable the interrupt. in addition, the gie bit must also be set. if any of these bits are cleared, the interrupt is not enabled, though the cmif bit will still be set if an interrupt condition occurs. the user, in the interrupt service routine, can clear the interrupt in the following manner: a) any read or write of cmcon. this will end the mismatch condition. b) clear flag bit cmif. a mismatch condition will continue to set flag bit cmif. reading cmcon will end the mismatch condition, and allow flag bit cmif to be cleared. table 6-2: registers associated with comparator module r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 vren ? vrr ? vr3 vr2 vr1 vr0 bit 7 bit 0 bit 7 vren: cv ref enable bit 1 = cv ref circuit powered on 0 = cv ref circuit powered down, no i dd drain bit 6 unimplemented: read as '0' bit 5 vrr: cv ref range selection bit 1 = low range 0 = high range bit 4 unimplemented: read as '0' bit 3-0 vr3:vr0: cv ref value selection 0 vr [3:0] 15 when vrr = 1: cv ref = (vr3:vr0 / 24) * v dd when vrr = 0: cv ref = v dd /4 + (vr3:vr0 / 32) * v dd legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown note: if a change in the cmcon register (cout) should occur when a read operation is being executed (start of the q2 cycle), then the cmif (pir1<3>) interrupt flag may not get set. address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 0bh/8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 00-- 0--0 19h cmcon ? cout ? cinv cis cm2 cm1 cm0 -0-0 0000 -0-0 0000 8ch pie1 eeie adie ? ? cmie ? ? tmr1ie 00-- 0--0 00-- 0--0 85h trisio ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 --11 1111 --11 1111 99h vrcon vren ? vrr ? vr3 vr2 vr1 vr0 0-0- 0000 0-0- 0000 legend: x = unknown, u = unchanged, - = unimplemented, read as ?0?. shaded cells are not used by the comparator module. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 41 pic12F629/675 7.0 analog-to-digital converter (a/d) module (pic12f675 only) the analog-to-digital converter (a/d) allows conversion of an analog input signal to a 10-bit binary representa- tion of that signal. the pic12f675 has four analog inputs, multiplexed into one sample and hold circuit. the output of the sample and hold is connected to the input of the converter. the converter generates a binary result via successive approximation and stores the result in a 10-bit register. the voltage reference used in the conversion is software selectable to either v dd or a voltage applied by the v ref pin. figure 7-1 shows the block diagram of the a/d on the pic12f675. figure 7-1: a/d block diagram 7.1 a/d configuration and operation there are two registers available to control the functionality of the a/d module: 1. adcon0 (register 7-1) 2. ansel (register 7-2) 7.1.1 analog port pins the ans3:ans0 bits (ansel<3:0>) and the trisio bits control the operation of the a/d port pins. set the corresponding trisio bits to set the pin output driver to its high impedance state. likewise, set the corresponding ans bit to disable the digital input buffer. 7.1.2 channel selection there are four analog channels on the pic12f675, an0 through an3. the chs1:chs0 bits (adcon0<3:2>) control which channel is connected to the sample and hold circuit. 7.1.3 voltage reference there are two options for the voltage reference to the a/d converter: either v dd is used, or an analog voltage applied to v ref is used. the vcfg bit (adcon0<6>) controls the voltage reference selection. if vcfg is set, then the voltage on the v ref pin is the reference; otherwise, v dd is the reference. 7.1.4 conversion clock the a/d conversion cycle requires 11 t ad . the source of the conversion clock is software selectable via the adcs bits (ansel<6:4>). there are seven possible clock options: f osc /2 f osc /4 f osc /8 f osc /16 f osc /32 f osc /64 f rc (dedicated internal rc oscillator) for correct conversion, the a/d conversion clock (1/t ad ) must be selected to ensure a minimum t ad of 1.6 s. table 7-1 shows a few t ad calculations for selected frequencies. gp0/an0 adc gp1/an1/v ref gp2/an2 gp4/an3 v dd v ref adon go/done vcfg = 1 vcfg = 0 chs1:chs0 adresh adresl 10 10 adfm v ss note: analog voltages on any pin that is defined as a digital input may cause the input buffer to conduct excess current. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 42 ? 2003 microchip technology inc. table 7-1: t ad vs. device operating frequencies 7.1.5 starting a conversion the a/d conversion is initiated by setting the go/done bit (adcon0<1>). when the conversion is complete, the a/d module:  clears the go/done bit  sets the adif flag (pir1<6>)  generates an interrupt (if enabled). if the conversion must be aborted, the go/done bit can be cleared in software. the adresh:adresl registers will not be updated with the partially complete a/d conversion sample. instead, the adresh:adresl registers will retain the value of the previous conversion. after an aborted conversion, a 2t ad delay is required before another acquisition can be initiated. following the delay, an input acquisition is automatically started on the selected channel. 7.1.6 conversion output the a/d conversion can be supplied in two formats: left or right shifted. the adfm bit (adcon0<7>) controls the output format. figure 7-2 shows the output formats. figure 7-2: 10-bit a/d result format a/d clock source (t ad ) device frequency operation adcs2:adcs0 20 mhz 5 mhz 4 mhz 1.25 mhz 2 t osc 000 100 ns (2) 400 ns (2) 500 ns (2) 1.6 s 4 t osc 100 200 ns (2) 800 ns (2) 1.0 s (2) 3.2 s 8 t osc 001 400 ns (2) 1.6 s 2.0 s 6.4 s 16 t osc 101 800 ns (2) 3.2 s 4.0 s 12.8 s (3) 32 t osc 010 1.6 s 6.4 s 8.0 s (3) 25.6 s (3) 64 t osc 110 3.2 s 12.8 s (3) 16.0 s (3) 51.2 s (3) a/d rc x11 2 - 6 s (1,4) 2 - 6 s (1,4) 2 - 6 s (1,4) 2 - 6 s (1,4) legend: shaded cells are outside of recommended range. note 1: the a/d rc source has a typical t ad time of 4 s for v dd > 3.0v. 2: these values violate the minimum required t ad time. 3: for faster conversion times, the selection of another clock source is recommended. 4: when the device frequency is greater than 1 mhz, the a/d rc clock source is only recommended if the conversion will be performed during sleep. note: the go/done bit should not be set in the same instruction that turns on the a/d. adresh adresl (adfm = 0) msb lsb bit 7 bit 0 bit 7 bit 0 10-bit a/d result unimplemented: read as ?0? (adfm = 1) msb lsb bit 7 bit 0 bit 7 bit 0 unimplemented: read as ?0 10-bit a/d result .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 43 pic12F629/675 register 7-1: adcon0 ? a/d control register (address: 1fh) r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 adfm vcfg ? ? chs1 chs0 go/done adon bit 7 bit 0 bit 7 adfm: a/d result formed select bit 1 = right justified 0 = left justified bit 6 vcfg: voltage reference bit 1 = v ref pin 0 = v dd bit 5-4 unimplemented: read as zero bit 3-2 chs1:chs0: analog channel select bits 00 = channel 00 (an0) 01 = channel 01 (an1) 10 = channel 02 (an2) 11 = channel 03 (an3) bit 1 go/done : a/d conversion status bit 1 = a/d conversion cycle in progress. setting this bit starts an a/d conversion cycle. this bit is automatically cleared by hardware when the a/d conversion has completed. 0 = a/d conversion completed/not in progress bit 0 adon: a/d conversion status bit 1 = a/d converter module is operating 0 = a/d converter is shut-off and consumes no operating current legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 44 ? 2003 microchip technology inc. register 7-2: ansel ? analog select register (address: 9fh) u-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 r/w-1 r/w-1 ? adcs2 adcs1 adcs0 ans3 ans2 ans1 ans0 bit 7 bit 0 bit 7 unimplemented: read as ?0?. bit 6-4 adcs<2:0>: a/d conversion clock select bits 000 = f osc /2 001 = f osc /8 010 = f osc /32 x11 = f rc (clock derived from a dedicated internal oscillator = 500 khz max) 100 = f osc /4 101 = f osc /16 110 = f osc /64 bit 3-0 ans3:ans0: analog select bits (between analog or digital function on pins an<3:0>, respectively.) 1 = analog input; pin is assigned as analog input (1) 0 = digital i/o; pin is assigned to port or special function note 1: setting a pin to an analog input automatically disables the digital input circuitry, weak pull-ups, and interrupt-on-change. the corresponding trisio bit must be set to input mode in order to allow external control of the voltage on the pin. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 45 pic12F629/675 7.2 a/d acquisition requirements for the a/d converter to meet its specified accuracy, the charge holding capacitor (c hold ) must be allowed to fully charge to the input channel voltage level. the analog input model is shown in figure 7-3. the source impedance (r s ) and the internal sampling switch (r ss ) impedance directly affect the time required to charge the capacitor c hold . the sampling switch (r ss ) impedance varies over the device voltage (v dd ), see figure 7-3. the maximum recommended imped- ance for analog sources is 10 k ? . as the impedance is decreased, the acquisition time may be decreased. after the analog input channel is selected (changed), this acquisition must be done before the conversion can be started. to calculate the minimum acquisition time, equation 7-1 may be used. this equation assumes that 1/2 lsb error is used (1024 steps for the a/d). the 1/2 lsb error is the maximum error allowed for the a/d to meet its specified resolution. to calculate the minimum acquisition time, t acq , see the picmicro? mid-range reference manual (ds33023). equation 7-1: acquisition time figure 7-3: analog input model t acq t c t acq = = = = = = = = amplifier settling time + hold capacitor charging time + temperature coefficient t amp + t c + t coff 2 s + t c + [(temperature -25 c)(0.05 s/c)] c hold (r ic + r ss + r s ) in(1/2047) - 120pf (1k ? + 7k ? + 10k ? ) in(0.0004885) 16.47 s 2 s + 16.47 s + [(50c -25 c)(0.05 s/ c) 19.72 s note 1: the reference voltage (v ref ) has no effect on the equation, since it cancels itself out. 2: the charge holding capacitor (c hold ) is not discharged after each conversion. 3: the maximum recommended impedance for analog sources is 10 k ? . this is required to meet the pin leakage specification. c pin va r s anx 5 pf v dd v t = 0.6v v t = 0.6v i leakage r ic 1k sampling switch ss r ss c hold = dac capacitance v ss 6v sampling switch 5v 4v 3v 2v 567891011 (k ? ) v dd = 120 pf 500 na legend c pin v t i leakage r ic ss c hold = input capacitance = threshold voltage = leakage current at the pin due to = interconnect resistance = sampling switch = sample/hold capacitance (from dac) various junctions .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 46 ? 2003 microchip technology inc. 7.3 a/d operation during sleep the a/d converter module can operate during sleep. this requires the a/d clock source to be set to the internal rc oscillator. when the rc clock source is selected, the a/d waits one instruction before starting the conversion. this allows the sleep instruction to be executed, thus eliminating much of the switching noise from the conversion. when the conversion is complete, the go/done bit is cleared, and the result is loaded into the adresh:adresl registers. if the a/d interrupt is enabled, the device awakens from sleep. if the a/d interrupt is not enabled, the a/d module is turned off, although the adon bit remains set. when the a/d clock source is something other than rc, a sleep instruction causes the present conversion to be aborted, and the a/d module is turned off. the adon bit remains set. 7.4 effects of reset a device reset forces all registers to their reset state. thus the a/d module is turned off and any pending conversion is aborted. the adresh:adresl registers are unchanged. table 7-2: summary of a/d registers address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on: por, bod value on all other resets 05h gpio ? ? gpio5 gpio4 gpio3 gpio2 gpio1 gpio0 --xx xxxx --uu uuuu 0bh, 8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 00-- 0--0 1eh adresh most significant 8 bits of the left shifted a/d result or 2 bits of the right shifted result xxxx xxxx uuuu uuuu 1fh adcon0 adfm vcfg ? ? chs1 chs0 go adon 00-- 0000 00-- 0000 85h trisio ? ? trisio5 trisio4 trisio3 trisio2 trisio1 trisio0 --11 1111 --11 1111 8ch pie1 eeie adie ? ? cmie ? ? tmr1ie 00-- 0--0 00-- 0--0 9eh adresl least significant 2 bits of the left shifted a/d result or 8 bits of the right shifted result xxxx xxxx uuuu uuuu 9fh ansel ? adcs2 adcs1 adcs0 ans3 ans2 ans1 ans0 -000 1111 -000 1111 legend: x = unknown, u = unchanged, - = unimplemented read as '0'. shaded cells are not used for a/d converter module. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 47 pic12F629/675 8.0 data eeprom memory the eeprom data memory is readable and writable during normal operation (full v dd range). this memory is not directly mapped in the register file space. instead, it is indirectly addressed through the special function registers. there are four sfrs used to read and write this memory: eecon1  eecon2 (not a physically implemented register) eedata eeadr eedata holds the 8-bit data for read/write, and eeadr holds the address of the eeprom location being accessed. pic12F629/675 devices have 128 bytes of data eeprom with an address range from 0h to 7fh. the eeprom data memory allows byte read and write. a byte write automatically erases the location and writes the new data (erase before write). the eeprom data memory is rated for high erase/write cycles. the write time is controlled by an on-chip timer. the write time will vary with voltage and temperature as well as from chip to chip. please refer to ac specifications for exact limits. when the data memory is code protected, the cpu may continue to read and write the data eeprom memory. the device programmer can no longer access this memory. additional information on the data eeprom is available in the picmicro? mid-range reference manual, (ds33023). register 8-1: eedat ? eeprom data register (address: 9ah) register 8-2: eeadr ? eeprom address register (address: 9bh) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 eedat7 eedat6 eedat5 eedat4 eedat3 eedat2 eedat1 eedat0 bit 7 bit 0 bit 7-0 eedatn : byte value to write to or read from data eeprom legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? eadr6 eadr5 eadr4 eadr3 eadr2 eadr1 eadr0 bit 7 bit 0 bit 7 unimplemented : should be set to '0' bit 6-0 eeadr : specifies one of 128 locations for eeprom read/write operation legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 48 ? 2003 microchip technology inc. 8.1 eeadr the eeadr register can address up to a maximum of 128 bytes of data eeprom. only seven of the eight bits in the register (eeadr<6:0>) are required. the msb (bit 7) is ignored. the upper bit should always be ?0? to remain upward compatible with devices that have more data eeprom memory. 8.2 eecon1 and eecon2 registers eecon1 is the control register with four low order bits physically implemented. the upper four bits are non- implemented and read as '0's. control bits rd and wr initiate read and write, respectively. these bits cannot be cleared, only set, in software. they are cleared in hardware at completion of the read or write operation. the inability to clear the wr bit in software prevents the accidental, premature termination of a write operation. the wren bit, when set, will allow a write operation. on power-up, the wren bit is clear. the wrerr bit is set when a write operation is interrupted by a mclr reset, or a wdt time-out reset during normal opera- tion. in these situations, following reset, the user can check the wrerr bit, clear it, and rewrite the location. the data and address will be cleared, therefore, the eedata and eeadr registers will need to be re- initialized. interrupt flag bit eeif in the pir1 register is set when write is complete. this bit must be cleared in software. eecon2 is not a physical register. reading eecon2 will read all '0's. the eecon2 register is used exclusively in the data eeprom write sequence. register 8-3: eecon1 ? eeprom control register (address: 9ch) u-0 u-0 u-0 u-0 r/w-x r/w-0 r/s-0 r/s-0 ? ? ? ? wrerr wren wr rd bit 7 bit 0 bit 7-4 unimplemented: read as ?0? bit 3 wrerr: eeprom error flag bit 1 = a write operation is prematurely terminated (any mclr reset, any wdt reset during normal operation or bod detect) 0 = the write operation completed bit 2 wren: eeprom write enable bit 1 = allows write cycles 0 = inhibits write to the data eeprom bit 1 wr : write control bit 1 = initiates a write cycle (the bit is cleared by hardware once write is complete. the wr bit can only be set, not cleared, in software.) 0 = write cycle to the data eeprom is complete bit 0 rd : read control bit 1 = initiates an eeprom read (read takes one cycle. rd is cleared in hardware. the rd bit can only be set, not cleared, in software.) 0 = does not initiate an eeprom read legend: s = bit can only be set r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 49 pic12F629/675 8.3 reading the eeprom data memory to read a data memory location, the user must write the address to the eeadr register and then set con- trol bit rd (eecon1<0>), as shown in example 8-1. the data is available, in the very next cycle, in the eedata register. therefore, it can be read in the next instruction. eedata holds this value until another read, or until it is written to by the user (during a write operation). example 8-1: data eeprom read 8.4 writing to the eeprom data memory to write an eeprom data location, the user must first write the address to the eeadr register and the data to the eedata register. then the user must follow a specific sequence to initiate the write for each byte, as shown in example 8-2. example 8-2: data eeprom write the write will not initiate if the above sequence is not exactly followed (write 55h to eecon2, write aah to eecon2, then set wr bit) for each byte. we strongly recommend that interrupts be disabled during this code segment. a cycle count is executed during the required sequence. any number that is not equal to the required cycles to execute the required sequence will prevent the data from being written into the eeprom. additionally, the wren bit in eecon1 must be set to enable write. this mechanism prevents accidental writes to data eeprom due to errant (unexpected) code execution (i.e., lost programs). the user should keep the wren bit clear at all times, except when updating eeprom. the wren bit is not cleared by hardware. after a write sequence has been initiated, clearing the wren bit will not affect this write cycle. the wr bit will be inhibited from being set unless the wren bit is set. at the completion of the write cycle, the wr bit is cleared in hardware and the ee write complete interrupt flag bit (eeif) is set. the user can either enable this interrupt or poll this bit. the eeif bit (pir<7>) register must be cleared by software. 8.5 write verify depending on the application, good programming practice may dictate that the value written to the data eeprom should be verified (see example 8-3) to the desired value to be written. example 8-3: write verify 8.5.1 using the data eeprom the data eeprom is a high-endurance, byte addres- sable array that has been optimized for the storage of frequently changing information (e.g., program variables or other data that are updated often). frequently changing values will typically be updated more often than specifications d120 or d120a. if this is not the case, an array refresh must be performed. for this reason, variables that change infrequently (such as constants, ids, calibration, etc.) should be stored in flash program memory. 8.6 protection against spurious write there are conditions when the device may not want to write to the data eeprom memory. to protect against spurious eeprom writes, various mechanisms have been built in. on power-up, wren is cleared. also, the power-up timer (72 ms duration) prevents eeprom write. the write initiate sequence and the wren bit together help prevent an accidental write during:  brown-out  power glitch  software malfunction bsf status,rp0 ;bank 1 movlw config_addr ; movwf eeadr ;address to read bsf eecon1,rd ;ee read movf eedata,w ;move data to w bsf status,rp0 ;bank 1 bsf eecon1,wren ;enable write bcf intcon,gie ;disable ints movlw 55h ;unlock write movwf eecon2 ; movlw aah ; movwf eecon2 ; bsf eecon1,wr ;start the write bsf intcon,gie ;enable ints required sequence bcf status,rp0 ;bank 0 : ;any code bsf status,rp0 ;bank 1 read movf eedata,w ;eedata not changed ;from previous write bsf eecon1,rd ;yes, read the ;value written xorwf eedata,w btfss status,z ;is data the same goto write_err ;no, handle error : ;yes, continue .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 50 ? 2003 microchip technology inc. 8.7 data eeprom operation during code protect data memory can be code protected by programming the cpd bit to ?0?. when the data memory is code protected, the cpu is able to read and write data to the data eeprom. it is recommended to code protect the program memory when code protecting data memory. this prevents anyone from programming zeroes over the existing code (which will execute as nop s) to reach an added routine, programmed in unused program memory, which outputs the contents of data memory. programming unused locations to ?0? will also help prevent data memory code protection from becoming breached. table 8-1: registers/bits associated with data eeprom address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 00-- 0--0 9ah eedata eeprom data register 0000 0000 0000 0000 9bh eeadr ? eeprom address register -000 0000 -000 0000 9ch eecon1 ? ? ? ? wrerr wren wr rd ---- x000 ---- q000 9dh eecon2 (1) eeprom control register 2 ---- ---- ---- ---- legend: x = unknown, u = unchanged, - = unimplemented read as '0', q = value depends upon condition. shaded cells are not used by data eeprom module. note 1: eecon2 is not a physical register. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 51 pic12F629/675 9.0 special features of the cpu certain special circuits that deal with the needs of real time applications are what sets a microcontroller apart from other processors. the pic12F629/675 family has a host of such features intended to:  maximize system reliability  minimize cost through elimination of external components  provide power saving operating modes and offer code protection. these features are:  oscillator selection  reset - power-on reset (por) - power-up timer (pwrt) - oscillator start-up timer (ost) - brown-out detect (bod)  interrupts  watchdog timer (wdt) sleep  code protection  id locations  in-circuit serial programming the pic12F629/675 has a watchdog timer that is controlled by configuration bits. it runs off its own rc oscillator for added reliability. there are two timers that offer necessary delays on power-up. one is the oscillator start-up timer (ost), intended to keep the chip in reset until the crystal oscillator is stable. the other is the power-up timer (pwrt), which provides a fixed delay of 72 ms (nominal) on power-up only, designed to keep the part in reset while the power supply stabilizes. there is also circuitry to reset the device if a brown-out occurs, which can provide at least a 72 ms reset. with these three functions on-chip, most applications need no external reset circuitry. the sleep mode is designed to offer a very low current power-down mode. the user can wake-up from sleep through:  external reset  watchdog timer wake-up  an interrupt several oscillator options are also made available to allow the part to fit the application. the intosc option saves system cost while the lp crystal option saves power. a set of configuration bits are used to select various options (see register 9-1). .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 52 ? 2003 microchip technology inc. 9.1 configuration bits the configuration bits can be programmed (read as '0'), or left unprogrammed (read as '1') to select various device configurations, as shown in register 9-1. these bits are mapped in program memory location 2007h. register 9-1: config ? configuration word (address: 2007h) note: address 2007h is beyond the user program memory space. it belongs to the special con- figuration memory space (2000h - 3fffh), which can be accessed only during program- ming. see pic12F629/675 programming specification for more information. r/p-1 r/p-1 u-0 u-0 u-0 r/p-1 r/p-1 r/p-1 r/p-1 r/p-1 r/p-1 r/p-1 r/p-1 r/p-1 bg1 bg0 ? ? ? cpd cp boden mclre pwrte wdte f0sc2 f0sc1 f0sc0 bit 13 bit 0 bit 13-12 bg1:bg0: bandgap calibration bits for bod and por voltage (1) 00 = lowest bandgap voltage 11 = highest bandgap voltage bit 11-9 unimplemented : read as ?0? bit 8 cpd : data code protection bit (2) 1 = data memory code protection is disabled 0 = data memory code protection is enabled bit 7 cp : code protection bit (3) 1 = program memory code protection is disabled 0 = program memory code protection is enabled bit 6 boden : brown-out detect enable bit (4) 1 = bod enabled 0 = bod disabled bit 5 mclre : gp3/mclr pin function select (5) 1 = gp3/mclr pin function is mclr 0 = gp3/mclr pin function is digital i/o, mclr internally tied to v dd bit 4 pwrte : power-up timer enable bit 1 = pwrt disabled 0 = pwrt enabled bit 3 wdte : watchdog timer enable bit 1 = wdt enabled 0 = wdt disabled bit 2-0 fosc2:fosc0 : oscillator selection bits 111 = rc oscillator: clkout function on gp4/osc2/clkout pin, rc on gp5/osc1/clkin 110 = rc oscillator: i/o function on gp4/osc2/clkout pin, rc on gp5/osc1/clkin 101 = intosc oscillator: clkout function on gp4/osc2/clkout pin, i/o function on gp5/osc1/clkin 100 = intosc oscillator: i/o function on gp4/osc2/clkout pin, i/o function on gp5/osc1/clkin 011 = ec: i/o function on gp4/osc2/clkout pin, clkin on gp5/osc1/clkin 010 = hs oscillator: high speed crystal/resonator on gp4/osc2/clkout and gp5/osc1/clkin 001 = xt oscillator: crystal/resonator on gp4/osc2/clkout and gp5/osc1/clkin 000 = lp oscillator: low power crystal on gp4/osc2/clkout and gp5/osc1/clkin note 1: the bandgap calibration bits are factory programmed and must be read and saved prior to erasing the device as specified in the pic12F629/675 programming specification. these bits are reflected in an export of the configuration word. microchip development tools maintain all calibration bits to factory settings. 2: the entire data eeprom will be erased when the code protection is turned off. 3: the entire program memory will be erased, including osccal value, when the code protection is turned off. 4: enabling brown-out detect does not automatically enable power-up timer. 5: when mclr is asserted in intosc or rc mode, the internal clock oscillator is disabled. legend: p = programmed using icsp r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 53 pic12F629/675 9.2 oscillator configurations 9.2.1 oscillator types the pic12F629/675 can be operated in eight different oscillator option modes. the user can program three configuration bits (fosc2 through fosc0) to select one of these eight modes:  lp low power crystal  xt crystal/resonator  hs high speed crystal/resonator  rc external resistor/capacitor (2 modes)  intosc internal oscillator (2 modes)  ec external clock in 9.2.2 crystal oscillator / ceramic resonators in xt, lp or hs modes a crystal or ceramic resonator is connected to the osc1 and osc2 pins to establish oscillation (see figure 9-1). the pic12F629/675 oscillator design requires the use of a parallel cut crystal. use of a series cut crystal may yield a frequency outside of the crystal manufacturers specifications. when in xt, lp or hs modes, the device can have an external clock source to drive the osc1 pin (see figure 9-2). figure 9-1: crystal operation (or ceramic resonator) hs, xt or lp osc configuration figure 9-2: external clock input operation (hs, xt, ec, or lp osc configuration) table 9-1: capacitor selection for ceramic resonators table 9-2: capacitor selection for crystal oscillator note: additional information on oscillator config- urations is available in the picmicro tm mid-range reference manual, (ds33023). note 1: see table 9-1 and table 9-2 for recommended values of c1 and c2. 2: a series resistor may be required for at strip cut crystals. 3: rf varies with the oscillator mode selected (approx. value = 10 m ?). c1 (1) c2 (1) xtal osc2 osc1 rf (3) sleep to internal pic12F629/675 logic rs (2) ranges characterized: mode freq osc1(c1) osc2(c2) xt 455 khz 2.0 mhz 4.0 mhz 68 - 100 pf 15 - 68 pf 15 - 68 pf 68 - 100 pf 15 - 68 pf 15 - 68 pf hs 8.0 mhz 16.0 mhz 10 - 68 pf 10 - 22 pf 10 - 68 pf 10 - 22 pf note 1: higher capacitance increases the stability of the oscillator but also increases the start-up time. these values are for design guidance only. since each resonator has its own characteristics, the user should consult the resonator manufacturer for appropriate values of external components. mode freq osc1(c1) osc2(c2) lp 32 khz 68 - 100 pf 68 - 100 pf xt 100 khz 2 mhz 4 mhz 68 - 150 pf 15 - 30 pf 15 - 30 pf 150 - 200 pf 15 - 30 pf 15 - 30 pf hs 8 mhz 10 mhz 20 mhz 15 - 30 pf 15 - 30 pf 15 - 30 pf 15 - 30 pf 15 - 30 pf 15 - 30 pf note 1: higher capacitance increases the stability of the oscillator but also increases the start-up time. these values are for design guidance only. rs may be required in hs mode as well as xt mode to avoid overdriving crystals with low drive level specification. since each crystal has its own characteristics, the user should consult the crystal manufacturer for appropriate values of external components. clock from external system pic12F629/675 osc1 osc2 (1) open note 1: functions as gp4 in ec osc mode. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 54 ? 2003 microchip technology inc. 9.2.3 external clock in for applications where a clock is already available elsewhere, users may directly drive the pic12F629/ 675 provided that this external clock source meets the ac/dc timing requirements listed in section 12.0. figure 9-2 shows how an external clock circuit should be configured. 9.2.4 rc oscillator for applications where precise timing is not a require- ment, the rc oscillator option is available. the opera- tion and functionality of the rc oscillator is dependent upon a number of variables. the rc oscillator frequency is a function of:  supply voltage  resistor (r ext ) and capacitor (c ext ) values  operating temperature. the oscillator frequency will vary from unit to unit due to normal process parameter variation. the difference in lead frame capacitance between package types will also affect the oscillation frequency, especially for low c ext values. the user also needs to account for the tolerance of the external r and c components. figure 9-3 shows how the r/c combination is connected. two options are available for this oscillator mode which allow gp4 to be used as a general purpose i/o or to output f osc /4. figure 9-3: rc oscillator mode 9.2.5 internal 4 mh z oscillator when calibrated, the internal oscillator provides a fixed 4 mhz (nominal) system clock. see electrical specifications, section 12.0, for information on variation over voltage and temperature. two options are available for this oscillator mode which allow gp4 to be used as a general purpose i/o or to output f osc /4. 9.2.5.1 calibrating the internal oscillator a calibration instruction is programmed into the last location of program memory. this instruction is a retlw xx , where the literal is the calibration value. the literal is placed in the osccal register to set the calibration of the internal oscillator. example 9-1 demonstrates how to calibrate the internal oscillator. for best operation, decouple (with capacitance) v dd and v ss as close to the device as possible. example 9-1: calibrating the internal oscillator 9.2.6 clkout the pic12F629/675 devices can be configured to provide a clock out signal in the intosc and rc oscillator modes. when configured, the oscillator frequency divided by four (f osc /4) is output on the gp4/osc2/clkout pin. f osc /4 can be used for test purposes or to synchronize other logic. gp4/osc2/clkout c ext v dd r ext v ss pic12F629/675 gp5/osc1/ f osc /4 internal clock clkin note: erasing the device will also erase the pre- programmed internal calibration value for the internal oscillator. the calibration value must be saved prior to erasing part as specified in the pic12F629/675 program- ming specification. microchip develop- ment tools maintain all calibration bits to factory settings. bsf status, rp0 ;bank 1 call 3ffh ;get the cal value movwf osccal ;calibrate bcf status, rp0 ;bank 0 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 55 pic12F629/675 9.3 reset the pic12F629/675 differentiates between various kinds of reset: a) power-on reset (por) b) wdt reset during normal operation c) wdt reset during sleep d) mclr reset during normal operation e) mclr reset during sleep f) brown-out detect (bod) some registers are not affected in any reset condition; their status is unknown on por and unchanged in any other reset. most other registers are reset to a ?reset state? on:  power-on reset mclr reset  wdt reset  wdt reset during sleep  brown-out detect (bod) reset they are not affected by a wdt wake-up, since this is viewed as the resumption of normal operation. to and pd bits are set or cleared differently in different reset situations as indicated in table 9-4. these bits are used in software to determine the nature of the reset. see table 9-7 for a full description of reset states of all registers. a simplified block diagram of the on-chip reset circuit is shown in figure 9-4. the mclr reset path has a noise filter to detect and ignore small pulses. see table 12-4 in electrical specifications section for pulse width specification. figure 9-4: simplified block diagram of on-chip reset circuit s r q external reset mclr / v dd osc1/ wdt module v dd rise detect ost/pwrt on-chip (1) rc osc wdt time-out power-on reset ost pwrt chip_reset 10-bit ripple counter reset enable ost enable pwrt sleep see table 9-3 for time-out situations. note 1: this is a separate oscillator from the intosc/ec oscillator. brown-out detect boden clkin pin v pp pin 10-bit ripple counter q .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 56 ? 2003 microchip technology inc. 9.3.1 mclr pic12F629/675 devices have a noise filter in the mclr reset path. the filter will detect and ignore small pulses. it should be noted that a wdt reset does not drive mclr pin low. the behavior of the esd protection on the mclr pin has been altered from previous devices of this family. voltages applied to the pin that exceed its specification can result in both mclr resets and excessive current beyond the device specification during the esd event. for this reason, microchip recommends that the mclr pin no longer be tied directly to v dd . the use of an rc network, as shown in figure 9-5, is suggested. an internal mclr option is enabled by setting the mclre bit in the configuration word. when enabled, mclr is internally tied to v dd . no internal pull-up option is available for the mclr pin. figure 9-5: recommended mclr circuit 9.3.2 power-on reset (por) the on-chip por circuit holds the chip in reset until v dd has reached a high enough level for proper operation. to take advantage of the por, simply tie the mclr pin through a resistor to v dd . this will eliminate external rc components usually needed to create power-on reset. a maximum rise time for v dd is required. see electrical specifications for details (see section 12.0). if the bod is enabled, the maximum rise time specification does not apply. the bod circuitry will keep the device in reset until v dd reaches v bod (see section 9.3.5). when the device starts normal operation (exits the reset condition), device operating parameters (i.e., voltage, frequency, temperature, etc.) must be met to ensure operation. if these conditions are not met, the device must be held in reset until the operating conditions are met. for additional information, refer to application note an607 ?power-up trouble shooting? . 9.3.3 power-up timer (pwrt) the power-up timer provides a fixed 72 ms (nominal) time-out on power-up only, from por or brown-out detect. the power-up timer operates on an internal rc oscillator. the chip is kept in reset as long as pwrt is active. the pwrt delay allows the v dd to rise to an acceptable level. a configuration bit, pwrte can disable (if set) or enable (if cleared or programmed) the power-up timer. the power-up timer should always be enabled when brown-out detect is enabled. the power-up time delay will vary from chip to chip and due to: v dd variation  temperature variation  process variation. see dc parameters for details (section 12.0). 9.3.4 oscillator start-up timer (ost) the oscillator start-up timer (ost) provides a 1024 oscillator cycle (from osc1 input) delay after the pwrt delay is over. this ensures that the crystal oscillator or resonator has started and stabilized. the ost time-out is invoked only for xt, lp and hs modes and only on power-on reset or wake-up from sleep. note: the por circuit does not produce an internal reset when v dd declines. v dd pic12F629/675 mclr r1 1 k ? ( or greater ) c1 0.1 f (optional, not critical) .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 57 pic12F629/675 9.3.5 brown-out detect (bod) the pic12F629/675 members have on-chip brown-out detect circuitry. a configuration bit, boden, can disable (if clear/programmed) or enable (if set) the brown-out detect circuitry. if v dd falls below v bod for greater than parameter (t bod ) in table 12-4 (see section 12.0), the brown-out situation will reset the device. this will occur regardless of v dd slew-rate. a reset is not guaranteed to occur if v dd falls below v bod for less than parameter (t bod ). on any reset (power-on, brown-out, watchdog, etc.), the chip will remain in reset until v dd rises above bv dd (see figure 9-6). the power-up timer will now be invoked, if enabled, and will keep the chip in reset an additional 72 ms. if v dd drops below bv dd while the power-up timer is running, the chip will go back into a brown-out detect and the power-up timer will be re-initialized. once v dd rises above bv dd , the power-up timer will execute a 72 ms reset. figure 9-6: brown-out situations 9.3.6 time-out sequence on power-up, the time-out sequence is as follows: first, pwrt time-out is invoked after por has expired. then, ost is activated. the total time-out will vary based on oscillator configuration and pwrte bit status. for example, in ec mode with pwrte bit erased (pwrt disabled), there will be no time-out at all. figure 9-7, figure 9-8 and figure 9-9 depict time- out sequences. since the time-outs occur from the por pulse, if mclr is kept low long enough, the time-outs will expire. then bringing mclr high will begin execution immediately (see figure 9-8). this is useful for testing purposes or to synchronize more than one pic12F629/675 device operating in parallel. table 9-6 shows the reset conditions for some special registers, while table 9-7 shows the reset conditions for all the registers. 9.3.7 power control (pcon) status register the power control/status register, pcon (address 8eh) has two bits. bit0 is bod (brown-out). bod is unknown on power- on reset. it must then be set by the user and checked on subsequent resets to see if bod = 0, indicating that a brown-out has occurred. the bod status bit is a don?t care and is not necessarily predictable if the brown-out circuit is disabled (by setting boden bit = 0 in the configuration word). bit1 is por (power-on reset). it is a ?0? on power-on reset and unaffected otherwise. the user must write a ?1? to this bit following a power-on reset. on a subsequent reset, if por is ?0?, it will indicate that a power-on reset must have occurred (i.e., v dd may have gone too low). note: a brown-out detect does not enable the power-up timer if the pwrte bit in the configuration word is set. 72 ms (1) v bod v dd internal reset v bod v dd internal reset 72 ms (1) <72 ms 72 ms (1) v bod v dd internal reset note 1: 72 ms delay only if pwrte bit is programmed to ?0?. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 58 ? 2003 microchip technology inc. table 9-3: time-out in various situations table 9-4: status/pcon bits and their significance table 9-5: summary of registers associated with brown-out table 9-6: initialization condition for special registers oscillator configuration power-up brown-out detect wake-up from sleep pwrte = 0 pwrte = 1 pwrte = 0 pwrte = 1 xt, hs, lp t pwrt + 1024t osc 1024t osc t pwrt + 1024t osc 1024t osc 1024t osc rc, ec, intosc t pwrt ? t pwrt ? ? por bod to pd 0 u 1 1 power-on reset 1 0 1 1 brown-out detect u u 0 u wdt reset u u 0 0 wdt wake-up u u u u mclr reset during normal operation u u 1 0 mclr reset during sleep legend: u = unchanged, x = unknown address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets (1) 03h status irp rp1 rpo to pd z dc c 0001 1xxx 000q quuu 8eh pcon ? ? ? ? ? ? por bod ---- --0x ---- --uq legend: u = unchanged, x = unknown, - = unimplemented bit, reads as ?0?, q = value depends on condition. note 1: other (non power-up) resets include mclr reset, brown-out detect and watchdog timer reset during normal operation. condition program counter status register pcon register power-on reset 000h 0001 1xxx ---- --0x mclr reset during normal operation 000h 000u uuuu ---- --uu mclr reset during sleep 000h 0001 0uuu ---- --uu wdt reset 000h 0000 uuuu ---- --uu wdt wake-up pc + 1 uuu0 0uuu ---- --uu brown-out detect 000h 0001 1uuu ---- --10 interrupt wake-up from sleep pc + 1 (1) uuu1 0uuu ---- --uu legend: u = unchanged, x = unknown, - = unimplemented bit, reads as ?0?. note 1: when the wake-up is due to an interrupt and global enable bit gie is set, the pc is loaded with the interrupt vector (0004h) after execution of pc+1. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 59 pic12F629/675 table 9-7: initialization condition for registers register address power-on reset mclr reset during normal operation mclr reset during sleep  wdt reset  brown-out detect (1)  wake-up from sleep through interrupt  wake-up from sleep through wdt time-out w ? xxxx xxxx uuuu uuuu uuuu uuuu indf 00h/80h ? ? ? tmr0 01h xxxx xxxx uuuu uuuu uuuu uuuu pcl 02h/82h 0000 0000 0000 0000 pc + 1 (3) status 03h/83h 0001 1xxx 000q quuu (4) uuuq quuu (4) fsr 04h/84h xxxx xxxx uuuu uuuu uuuu uuuu gpio 05h --xx xxxx --uu uuuu --uu uuuu pclath 0ah/8ah ---0 0000 ---0 0000 ---u uuuu intcon 0bh/8bh 0000 0000 0000 000u uuuu uuqq (2) pir1 0ch 00-- 0--0 00-- 0--0 qq-- q--q (2,5) t1con 10h -000 0000 -uuu uuuu -uuu uuuu cmcon 19h -0-0 0000 -0-0 0000 -u-u uuuu adresh 1eh xxxx xxxx uuuu uuuu uuuu uuuu adcon0 1fh 00-- 0000 00-- 0000 uu-- uuuu option_reg 81h 1111 1111 1111 1111 uuuu uuuu trisio 85h --11 1111 --11 1111 --uu uuuu pie1 8ch 00-- 0--0 00-- 0--0 uu-- u--u pcon 8eh ---- --0x ---- --uu (1,6) ---- --uu osccal 90h 1000 00-- 1000 00-- uuuu uu-- wpu 95h --11 -111 --11 -111 uuuu uuuu ioc 96h --00 0000 --00 0000 --uu uuuu vrcon 99h 0-0- 0000 0-0- 0000 u-u- uuuu eedata 9ah 0000 0000 0000 0000 uuuu uuuu eeadr 9bh -000 0000 -000 0000 -uuu uuuu eecon1 9ch ---- x000 ---- q000 ---- uuuu eecon2 9dh ---- ---- ---- ---- ---- ---- adresl 9eh xxxx xxxx uuuu uuuu uuuu uuuu ansel 9fh -000 1111 -000 1111 -uuu uuuu legend: u = unchanged, x = unknown, - = unimplemented bit, reads as ?0?, q = value depends on condition. note 1: if v dd goes too low, power-on reset will be activated and registers will be affected differently. 2: one or more bits in intcon and/or pir1 will be affected (to cause wake-up). 3: when the wake-up is due to an interrupt and the gie bit is set, the pc is loaded with the interrupt vector (0004h). 4: see table 9-6 for reset value for specific condition. 5: if wake-up was due to data eeprom write completing, bit 7 = 1; a/d conversion completing, bit 6 = 1; comparator input changing, bit 3 = 1; or timer1 rolling over, bit 0 = 1. all other interrupts generating a wake-up will cause these bits to = u. 6: if reset was due to brown-out, then bit 0 = 0. all other resets will cause bit 0 = u. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 60 ? 2003 microchip technology inc. figure 9-7: time-out sequence on power-up (mclr not tied to v dd ): case 1 figure 9-8: time-out sequence on power-up (mclr not tied to v dd ): case 2 figure 9-9: time-out sequence on power-up (mclr tied to v dd ) t pwrt t ost v dd mclr internal por pwrt time-out ost time-out internal reset v dd mclr internal por pwrt time-out ost time-out internal reset t pwrt t ost t pwrt t ost v dd mclr internal por pwrt time-out ost time-out internal reset .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 61 pic12F629/675 9.4 interrupts the pic12F629/675 has 7 sources of interrupt:  external interrupt gp2/int  tmr0 overflow interrupt  gpio change interrupts  comparator interrupt  a/d interrupt (pic12f675 only)  tmr1 overflow interrupt  eeprom data write interrupt the interrupt control register (intcon) and peripheral interrupt register (pir) record individual interrupt requests in flag bits. the intcon register also has individual and global interrupt enable bits. a global interrupt enable bit, gie (intcon<7>) enables (if set) all unmasked interrupts, or disables (if cleared) all interrupts. individual interrupts can be disabled through their corresponding enable bits in intcon register and pie register. gie is cleared on reset. the return from interrupt instruction, retfie , exits interrupt routine, as well as sets the gie bit, which re-enables unmasked interrupts. the following interrupt flags are contained in the intcon register:  int pin interrupt  gp port change interrupt  tmr0 overflow interrupt the peripheral interrupt flags are contained in the special register pir1. the corresponding interrupt enable bit is contained in special register pie1. the following interrupt flags are contained in the pir register:  eeprom data write interrupt  a/d interrupt  comparator interrupt  timer1 overflow interrupt when an interrupt is serviced:  the gie is cleared to disable any further interrupt  the return address is pushed onto the stack  the pc is loaded with 0004h once in the interrupt service routine, the source(s) of the interrupt can be determined by polling the interrupt flag bits. the interrupt flag bit(s) must be cleared in software before re-enabling interrupts to avoid gp2/ int recursive interrupts. for external interrupt events, such as the int pin, or gp port change interrupt, the interrupt latency will be three or four instruction cycles. the exact latency depends upon when the interrupt event occurs (see figure 9-11). the latency is the same for one or two- cycle instructions. once in the interrupt service routine, the source(s) of the interrupt can be determined by polling the interrupt flag bits. the interrupt flag bit(s) must be cleared in software before re-enabling interrupts to avoid multiple interrupt requests. note 1: individual interrupt flag bits are set, regardless of the status of their corresponding mask bit or the gie bit. 2: when an instruction that clears the gie bit is executed, any interrupts that were pending for execution in the next cycle are ignored. the interrupts which were ignored are still pending to be serviced when the gie bit is set again. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 62 ? 2003 microchip technology inc. figure 9-10: interrupt logic tmr1if tmr1ie cmif cmie t0if t0ie intf inte gpif gpie gie peie wake-up (if in sleep mode) interrupt to cpu eeie eeif adif adie (1) note 1: pic12f675 only. ioc-gp0 ioc0 ioc-gp1 ioc1 ioc-gp2 ioc2 ioc-gp3 ioc3 ioc-gp4 ioc4 ioc-gp5 ioc5 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 63 pic12F629/675 9.4.1 gp2/int interrupt external interrupt on gp2/int pin is edge-triggered; either rising if intedg bit (option<6>) is set, of falling, if intedg bit is clear. when a valid edge appears on the gp2/int pin, the intf bit (intcon<1>) is set. this interrupt can be disabled by clearing the inte control bit (intcon<4>). the intf bit must be cleared in software in the interrupt service routine before re-enabling this interrupt. the gp2/int interrupt can wake-up the processor from sleep if the inte bit was set prior to going into sleep. the status of the gie bit decides whether or not the processor branches to the interrupt vector following wake-up. see section 9.7 for details on sleep and figure 9-13 for timing of wake-up from sleep through gp2/int interrupt. 9.4.2 tmr0 interrupt an overflow (ffh 00h) in the tmr0 register will set the t0if (intcon<2>) bit. the interrupt can be enabled/disabled by setting/clearing t0ie (intcon<5>) bit. for operation of the timer0 module, see section 4.0. 9.4.3 gpio interrupt an input change on gpio change sets the gpif (intcon<0>) bit. the interrupt can be enabled/ disabled by setting/clearing the gpie (intcon<3>) bit. plus individual pins can be configured through the ioc register. 9.4.4 comparator interrupt see section 6.9 for description of comparator interrupt. 9.4.5 a/d converter interrupt after a conversion is complete, the adif flag (pir<6>) is set. the interrupt can be enabled/disabled by setting or clearing adie (pie<6>). see section 7.0 for operation of the a/d converter interrupt. figure 9-11: int pin interrupt timing note: the ansel (9fh) and cmcon (19h) registers must be initialized to configure an analog channel as a digital input. pins configured as analog inputs will read ?0?. the ansel register is defined for the pic12f675. note: if a change on the i/o pin should occur when the read operation is being executed (start of the q2 cycle), then the gpif inter- rupt flag may not get set. q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 osc1 clkout int pin intf flag (intcon<1>) gie bit (intcon<7>) instruction flow pc instruction fetched instruction executed interrupt latency pc pc+1 pc+1 0004h 0005h inst (0004h) inst (0005h) dummy cycle inst (pc) inst (pc+1) inst (pc-1) inst (0004h) dummy cycle inst (pc) ? 1 4 5 1 2 3 note 1: intf flag is sampled here (every q1). 2: asynchronous interrupt latency = 3-4 t cy . synchronous latency = 3 t cy , where t cy = instruction cycle time. latency is the same whether inst (pc) is a single cycle or a 2-cycle instruction. 3: clkout is available only in rc oscillator mode. 4: for minimum width of int pulse, refer to ac specs. 5: intf is enabled to be set any time during the q4-q1 cycles. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 64 ? 2003 microchip technology inc. table 9-8: summary of interrupt registers 9.5 context saving during interrupts during an interrupt, only the return pc value is saved on the stack. typically, users may wish to save key registers during an interrupt, e.g., w register and status register. this must be implemented in software. example 9-2 stores and restores the status and w registers. the user register, w_temp, must be defined in both banks and must be defined at the same offset from the bank base address (i.e., w_temp is defined at 0x20 in bank 0 and it must also be defined at 0xa0 in bank 1). the user register, status_temp, must be defined in bank 0. the example 9-2:  stores the w register  stores the status register in bank 0  executes the isr code  restores the status (and bank select bit register)  restores the w register example 9-2: saving the status and w registers in ram 9.6 watchdog timer (wdt) the watchdog timer is a free running, on-chip rc oscillator, which requires no external components. this rc oscillator is separate from the external rc oscillator of the clkin pin and intosc. that means that the wdt will run, even if the clock on the osc1 and osc2 pins of the device has been stopped (for example, by execution of a sleep instruction). during normal operation, a wdt time-out generates a device reset. if the device is in sleep mode, a wdt time-out causes the device to wake-up and continue with normal operation. the wdt can be permanently disabled by programming the configuration bit wdte as clear (section 9.1). 9.6.1 wdt period the wdt has a nominal time-out period of 18 ms, (with no prescaler). the time-out periods vary with tempera- ture, v dd and process variations from part to part (see dc specs). if longer time-out periods are desired, a prescaler with a division ratio of up to 1:128 can be assigned to the wdt under software control by writing to the option register. thus, time-out periods up to 2.3 seconds can be realized. the clrwdt and sleep instructions clear the wdt and the prescaler, if assigned to the wdt, and prevent it from timing out and generating a device reset. the to bit in the status register will be cleared upon a watchdog timer time-out. 9.6.2 wdt programming considerations it should also be taken in account that under worst case conditions (i.e., v dd = min., temperature = max., max. wdt prescaler) it may take several seconds before a wdt time-out occurs. address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 0bh, 8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 0000 0000 000u 0ch pir1 eeif adif ? ? cmif ? ? tmr1if 00-- 0--0 00-- 0--0 8ch pie1 eeie adie ? ? cmie ? ? tmr1ie 00-- 0--0 00-- 0--0 legend: x = unknown, u = unchanged, - = unimplemented read as '0', q = value depends upon condition. shaded cells are not used by the interrupt module. movwf w_temp ;copy w to temp register, could be in either bank swapf status,w ;swap status to be saved into w bcf status,rp0 ;change to bank 0 regardless of current bank movwf status_temp ;save status to bank 0 register : :(isr) : swapf status_temp,w;swap status_temp register into w, sets bank to original state movwf status ;move w into status register swapf w_temp,f ;swap w_temp swapf w_temp,w ;swap w_temp into w .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 65 pic12F629/675 figure 9-12: watchdog timer block diagram table 9-9: summary of watchdog timer registers t0cki t0se pin clkout tmr0 watchdog timer wdt time-out ps0 - ps2 wdte data bus set flag bit t0if on overflow t0cs note 1: t0se, t0cs, psa, ps0-ps2 are bits in the option register. 0 1 0 1 0 1 sync 2 cycles 8 8 8-bit prescaler 0 1 (= f osc /4) psa psa psa address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por, bod value on all other resets 81h option_reg gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 2007h config. bits cp boden mclre pwrte wdte f0sc2 f0sc1 f0sc0 uuuu uuuu uuuu uuuu legend: u = unchanged, shaded cells are not used by the watchdog timer. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 66 ? 2003 microchip technology inc. 9.7 power-down mode (sleep) the power-down mode is entered by executing a sleep instruction. if the watchdog timer is enabled:  wdt will be cleared but keeps running pd bit in the status register is cleared to bit is set  oscillator driver is turned off  i/o ports maintain the status they had before sleep was executed (driving high, low, or hi-impedance). for lowest current consumption in this mode, all i/o pins should be either at v dd , or v ss , with no external circuitry drawing current from the i/o pin and the com- parators and cv ref should be disabled. i/o pins that are hi-impedance inputs should be pulled high or low externally to avoid switching currents caused by float- ing inputs. the t0cki input should also be at v dd or v ss for lowest current consumption. the contribution from on-chip pull-ups on gpio should be considered. the mclr pin must be at a logic high level (v ihmc ). 9.7.1 wake-up from sleep the device can wake-up from sleep through one of the following events: 1. external reset input on mclr pin 2. watchdog timer wake-up (if wdt was enabled) 3. interrupt from gp2/int pin, gpio change, or a peripheral interrupt. the first event will cause a device reset. the two latter events are considered a continuation of program execution. the to and pd bits in the status register can be used to determine the cause of device reset. the pd bit, which is set on power-up, is cleared when sleep is invoked. to bit is cleared if wdt wake-up occurred. when the sleep instruction is being executed, the next instruction (pc + 1) is pre-fetched. for the device to wake-up through an interrupt event, the correspond- ing interrupt enable bit must be set (enabled). wake-up is regardless of the state of the gie bit. if the gie bit is clear (disabled), the device continues execution at the instruction after the sleep instruction. if the gie bit is set (enabled), the device executes the instruction after the sleep instruction, then branches to the interrupt address (0004h). in cases where the execution of the instruction following sleep is not desirable, the user should have an nop after the sleep instruction. the wdt is cleared when the device wakes up from sleep, regardless of the source of wake-up. figure 9-13: wake-up from sleep through interrupt note: it should be noted that a reset generated by a wdt time-out does not drive mclr pin low. note: if the global interrupts are disabled (gie is cleared), but any interrupt source has both its interrupt enable bit and the correspond- ing interrupt flag bits set, the device will immediately wake-up from sleep. the sleep instruction is completely executed. q1 q2 q3 q4 q1 q2 q3 q4 q1 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 osc1 clkout (4) int pin intf flag (intcon<1>) gie bit (intcon<7>) instruction flow pc instruction fetched instruction executed pc pc+1 pc+2 inst(pc) = sleep inst(pc - 1) inst(pc + 1) sleep processor in sleep interrupt latency (note 2) inst(pc + 2) inst(pc + 1) inst(0004h) inst(0005h) inst(0004h) dummy cycle pc + 2 0004h 0005h dummy cycle t ost (2) pc+2 note 1: xt, hs or lp oscillator mode assumed. 2: t ost = 1024t osc (drawing not to scale). approximately 1 s delay will be there for rc osc mode. see section 12 for wake-up from sleep delay in intosc mode. 3: gie = '1' assumed. in this case after wake-up, the processor jumps to the interrupt routine. if gie = '0', execution will conti nue in-line. 4: clkout is not available in xt, hs, lp or ec osc modes, but shown here for timing reference. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 67 pic12F629/675 9.8 code protection if the code protection bit(s) have not been programmed, the on-chip program memory can be read out for verification purposes. 9.9 id locations four memory locations (2000h-2003h) are designated as id locations where the user can store checksum or other code identification numbers. these locations are not accessible during normal execution but are readable and writable during program/verify. only the least significant 7 bits of the id locations are used. 9.10 in-circuit serial programming the pic12F629/675 microcontrollers can be serially programmed while in the end application circuit. this is simply done with two lines for clock and data, and three other lines for: power ground  programming voltage this allows customers to manufacture boards with unprogrammed devices, and then program the microcontroller just before shipping the product. this also allows the most recent firmware or a custom firmware to be programmed. the device is placed into a program/verify mode by holding the gp0 and gp1 pins low, while raising the mclr (v pp ) pin from v il to v ihh (see programming specification). gp0 becomes the programming data and gp1 becomes the programming clock. both gp0 and gp1 are schmitt trigger inputs in this mode. after reset, to place the device into programming/ verify mode, the program counter (pc) is at location 00h. a 6-bit command is then supplied to the device. depending on the command, 14-bits of program data are then supplied to or from the device, depending on whether the command was a load or a read. for complete details of serial programming, please refer to the programming specifications. a typical in-circuit serial programming connection is shown in figure 9-14. figure 9-14: typical in-circuit serial programming connection 9.11 in-circuit debugger since in-circuit debugging requires the loss of clock, data and mclr pins, mplab ? icd 2 development with an 8-pin device is not practical. a special 14-pin pic12f675-icd device is used with mplab icd 2 to provide separate clock, data and mclr pins and frees all normally available pins to the user. this special icd device is mounted on the top of the header and its signals are routed to the mplab icd 2 connector. on the bottom of the header is an 8-pin socket that plugs into the user?s target via the 8-pin stand-off connector. when the icd pin on the pic12f675-icd device is held low, the in-circuit debugger functionality is enabled. this function allows simple debugging functions when used with mplab icd 2. when the microcontroller has this feature enabled, some of the resources are not available for general use. table 9-10 shows which features are consumed by the background debugger: table 9-10: debugger resources for more information, see 8-pin mplab icd 2 header information sheet (ds51292) available on microchip?s website (www.microchip.com). note: the entire data eeprom and flash program memory will be erased when the code protection is turned off. the intosc calibration data is also erased. see pic12F629/675 programming specifica- tion for more information. i/o pins icdclk, icddata stack 1 level program memory address 0h must be nop 300h - 3feh external connector signals to normal connections to normal connections pic12F629/675 v dd v ss gp3/mclr /v pp gp1 gp0 +5v 0v v pp clk data i/o v dd .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 68 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 69 pic12F629/675 10.0 instruction set summary the pic12F629/675 instruction set is highly orthogonal and is comprised of three basic categories:  byte-oriented operations  bit-oriented operations  literal and control operations each pic12F629/675 instruction is a 14-bit word divided into an opcode, which specifies the instruction type, and one or more operands, which further specify the operation of the instruction. the formats for each of the categories is presented in figure 10-1, while the various opcode fields are summarized in table 10-1. table 10-2 lists the instructions recognized by the mpasm tm assembler. a complete description of each instruction is also available in the picmicro? mid-range reference manual (ds33023). for byte-oriented instructions, ? f ? represents a file register designator and ? d ? represents a destination designator. the file register designator specifies which file register is to be used by the instruction. the destination designator specifies where the result of the operation is to be placed. if ? d ? is zero, the result is placed in the w register. if ? d ? is one, the result is placed in the file register specified in the instruction. for bit-oriented instructions, ? b ? represents a bit field designator, which selects the bit affected by the operation, while ? f ? represents the address of the file in which the bit is located. for literal and control operations, ? k ? represents an 8-bit or 11-bit constant, or literal value. one instruction cycle consists of four oscillator periods; for an oscillator frequency of 4 mhz, this gives a normal instruction execution time of 1 s. all instructions are executed within a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of an instruction. when this occurs, the execution takes two instruction cycles, with the second cycle executed as a nop . all instruction examples use the format ?0xhh? to represent a hexadecimal number, where ?h? signifies a hexadecimal digit. 10.1 read-modify-write operations any instruction that specifies a file register as part of the instruction performs a read-modify-write (r-m-w) operation. the register is read, the data is modified, and the result is stored according to either the instruc- tion, or the destination designator ?d?. a read operation is performed on a register even if the instruction writes to that register. for example, a clrf gpio instruction will read gpio, clear all the data bits, then write the result back to gpio. this example would have the unintended result that the condition that sets the gpif flag would be cleared. table 10-1: opcode field descriptions figure 10-1: general format for instructions note: to maintain upward compatibility with future products, do not use the option and trisio instructions. field description f register file address (0x00 to 0x7f) w working register (accumulator) b bit address within an 8-bit file register k literal field, constant data or label x don't care location (= 0 or 1 ). the assembler will generate code with x = 0 . it is the recommended form of use for compatibility with all microchip software tools. d destination select; d = 0 : store result in w, d = 1: store result in file register f. default is d = 1. pc program counter to time-out bit pd power-down bit byte-oriented file register operations 13 8 7 6 0 d = 0 for destination w opcode d f (file #) d = 1 for destination f f = 7-bit file register address bit-oriented file register operations 13 10 9 7 6 0 opcode b (bit #) f (file #) b = 3-bit bit address f = 7-bit file register address literal and control operations 13 8 7 0 opcode k (literal) k = 8-bit immediate value 13 11 10 0 opcode k (literal) k = 11-bit immediate value general call and goto instructions only .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 70 ? 2003 microchip technology inc. table 10-2: pic12F629/675 instruction set mnemonic, operands description cycles 14-bit opcode status affected notes msb lsb byte-oriented file register operations addwf andwf clrf clrw comf decf decfsz incf incfsz iorwf movf movwf nop rlf rrf subwf swapf xorwf f, d f, d f - f, d f, d f, d f, d f, d f, d f, d f - f, d f, d f, d f, d f, d add w and f and w with f clear f clear w complement f decrement f decrement f, skip if 0 increment f increment f, skip if 0 inclusive or w with f move f move w to f no operation rotate left f through carry rotate right f through carry subtract w from f swap nibbles in f exclusive or w with f 1 1 1 1 1 1 1(2) 1 1(2) 1 1 1 1 1 1 1 1 1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0111 0101 0001 0001 1001 0011 1011 1010 1111 0100 1000 0000 0000 1101 1100 0010 1110 0110 dfff dfff lfff 0xxx dfff dfff dfff dfff dfff dfff dfff lfff 0xx0 dfff dfff dfff dfff dfff ffff ffff ffff xxxx ffff ffff ffff ffff ffff ffff ffff ffff 0000 ffff ffff ffff ffff ffff c,dc,z z z z z z z z z c c c,dc,z z 1,2 1,2 2 1,2 1,2 1,2,3 1,2 1,2,3 1,2 1,2 1,2 1,2 1,2 1,2 1,2 bit-oriented file register operations bcf bsf btfsc btfss f, b f, b f, b f, b bit clear f bit set f bit test f, skip if clear bit test f, skip if set 1 1 1 (2) 1 (2) 01 01 01 01 00bb 01bb 10bb 11bb bfff bfff bfff bfff ffff ffff ffff ffff 1,2 1,2 3 3 literal and control operations addlw andlw call clrwdt goto iorlw movlw retfie retlw return sleep sublw xorlw k k k - k k k - k - - k k add literal and w and literal with w call subroutine clear watchdog timer go to address inclusive or literal with w move literal to w return from interrupt return with literal in w return from subroutine go into standby mode subtract w from literal exclusive or literal with w 1 1 2 1 2 1 1 2 2 2 1 1 1 11 11 10 00 10 11 11 00 11 00 00 11 11 111x 1001 0kkk 0000 1kkk 1000 00xx 0000 01xx 0000 0000 110x 1010 kkkk kkkk kkkk 0110 kkkk kkkk kkkk 0000 kkkk 0000 0110 kkkk kkkk kkkk kkkk kkkk 0100 kkkk kkkk kkkk 1001 kkkk 1000 0011 kkkk kkkk c,dc,z z to ,pd z to ,pd c,dc,z z note 1: when an i/o register is modified as a function of itself (e.g., movf gpio , 1 ), the value used will be that value present on the pins themselves. for example, if the data latch is '1' for a pin configured as input and is driven low by an external device, the data will be written back with a '0'. 2: if this instruction is executed on the tmr0 register (and, where applicable, d = 1), the prescaler will be cleared if assigned to the timer0 module. 3: if program counter (pc) is modified, or a conditional test is true, the instruction requires two cycles. the second cycle is executed as a nop . note: additional information on the mid-range instruction set is available in the picmicro ? mid-range mcu family reference manual (ds33023). .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 71 pic12F629/675 10.2 instruction descriptions addlw add literal and w syntax: [ label ] addlw k operands: 0 k 255 operation: (w) + k (w) status affected: c, dc, z description: the contents of the w register are added to the eight-bit literal 'k' and the result is placed in the w register. addwf add w and f syntax: [ label ] addwf f,d operands: 0 f 127 d [0,1] operation: (w) + (f) (destination) status affected: c, dc, z description: add the contents of the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. andlw and literal with w syntax: [ label ] andlw k operands: 0 k 255 operation: (w) .and. (k) (w) status affected: z description: the contents of w register are and?ed with the eight-bit literal 'k'. the result is placed in the w register. andwf and w with f syntax: [ label ] andwf f,d operands: 0 f 127 d [0,1] operation: (w) .and. (f) (destination) status affected: z description: and the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. bcf bit clear f syntax: [ label ] bcf f,b operands: 0 f 127 0 b 7 operation: 0 (f) status affected: none description: bit 'b' in register 'f' is cleared. bsf bit set f syntax: [ label ] bsf f,b operands: 0 f 127 0 b 7 operation: 1 (f) status affected: none description: bit 'b' in register 'f' is set. btfss bit test f, skip if set syntax: [ label ] btfss f,b operands: 0 f 127 0 b < 7 operation: skip if (f) = 1 status affected: none description: if bit 'b' in register 'f' is '0', the next instruction is executed. if bit 'b' is '1', then the next instruction is discarded and a nop is executed instead, making this a 2t cy instruction. btfsc bit test, skip if clear syntax: [ label ] btfsc f,b operands: 0 f 127 0 b 7 operation: skip if (f) = 0 status affected: none description: if bit 'b' in register 'f' is '1', the next instruction is executed. if bit 'b', in register 'f', is '0', the next instruction is discarded, and a nop is executed instead, making this a 2t cy instruction. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 72 ? 2003 microchip technology inc. call call subroutine syntax: [ label ] call k operands: 0 k 2047 operation: (pc)+ 1 tos, k pc<10:0>, (pclath<4:3>) pc<12:11> status affected: none description: call subroutine. first, return address (pc+1) is pushed onto the stack. the eleven-bit immedi- ate address is loaded into pc bits <10:0>. the upper bits of the pc are loaded from pclath. call is a two-cycle instruction. clrf clear f syntax: [ label ] clrf f operands: 0 f 127 operation: 00h (f) 1 z status affected: z description: the contents of register 'f' are cleared and the z bit is set. clrw clear w syntax: [ label ] clrw operands: none operation: 00h (w) 1 z status affected: z description: w register is cleared. zero bit (z) is set. clrwdt clear watchdog timer syntax: [ label ] clrwdt operands: none operation: 00h wdt 0 wdt prescaler, 1 to 1 pd status affected: to , pd description: clrwdt instruction resets the watchdog timer. it also resets the prescaler of the wdt. status bits to and pd are set. comf complement f syntax: [ label ] comf f,d operands: 0 f 127 d [0,1] operation: (f ) (destination) status affected: z description: the contents of register 'f' are complemented. if 'd' is 0, the result is stored in w. if 'd' is 1, the result is stored back in register 'f'. decf decrement f syntax: [ label ] decf f,d operands: 0 f 127 d [0,1] operation: (f) - 1 (destination) status affected: z description: decrement register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 73 pic12F629/675 decfsz decrement f, skip if 0 syntax: [ label ] decfsz f,d operands: 0 f 127 d [0,1] operation: (f) - 1 (destination); skip if result = 0 status affected: none description: the contents of register 'f' are decremented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. if the result is 1, the next instruc- tion is executed. if the result is 0, then a nop is executed instead, making it a 2t cy instruction. goto unconditional branch syntax: [ label ] goto k operands: 0 k 2047 operation: k pc<10:0> pclath<4:3> pc<12:11> status affected: none description: goto is an unconditional branch. the eleven-bit immediate value is loaded into pc bits <10:0>. the upper bits of pc are loaded from pclath<4:3>. goto is a two- cycle instruction. incf increment f syntax: [ label ] incf f,d operands: 0 f 127 d [0,1] operation: (f) + 1 (destination) status affected: z description: the contents of register 'f' are incremented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. incfsz increment f, skip if 0 syntax: [ label ] incfsz f,d operands: 0 f 127 d [0,1] operation: (f) + 1 (destination), skip if result = 0 status affected: none description: the contents of register 'f' are incremented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. if the result is 1, the next instruc- tion is executed. if the result is 0, a nop is executed instead, making it a 2t cy instruction. iorlw inclusive or literal with w syntax: [ label ] iorlw k operands: 0 k 255 operation: (w) .or. k (w) status affected: z description: the contents of the w register are or?ed with the eight-bit literal 'k'. the result is placed in the w register. iorwf inclusive or w with f syntax: [ label ] iorwf f,d operands: 0 f 127 d [0,1] operation: (w) .or. (f) (destination) status affected: z description: inclusive or the w register with register 'f'. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 74 ? 2003 microchip technology inc. movf move f syntax: [ label ] movf f,d operands: 0 f 127 d [0,1] operation: (f) (destination) status affected: z description: the contents of register f are moved to a destination dependant upon the status of d. if d = 0, destination is w register. if d = 1, the destination is file register f itself. d = 1 is useful to test a file register, since status flag z is affected. movlw move literal to w syntax: [ label ] movlw k operands: 0 k 255 operation: k (w) status affected: none description: the eight-bit literal 'k' is loaded into w register. the don?t cares will assemble as 0?s. movwf move w to f syntax: [ label ] movwf f operands: 0 f 127 operation: (w) (f) status affected: none description: move data from w register to register 'f'. nop no operation syntax: [ label ] nop operands: none operation: no operation status affected: none description: no operation. retfie return from interrupt syntax: [ label ] retfie operands: none operation: tos pc, 1 gie status affected: none retlw return with literal in w syntax: [ label ] retlw k operands: 0 k 255 operation: k (w); tos pc status affected: none description: the w register is loaded with the eight-bit literal 'k'. the program counter is loaded from the top of the stack (the return address). this is a two-cycle instruction. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 75 pic12F629/675 rlf rotate left f through carry syntax: [ label ] rlf f,d operands: 0 f 127 d [0,1] operation: see description below status affected: c description: the contents of register 'f' are rotated one bit to the left through the carry flag. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is stored back in register 'f'. return return from subroutine syntax: [ label ] return operands: none operation: tos pc status affected: none description: return from subroutine. the stack is poped and the top of the stack (tos) is loaded into the program counter. this is a two-cycle instruction. rrf rotate right f through carry syntax: [ label ] rrf f,d operands: 0 f 127 d [0,1] operation: see description below status affected: c description: the contents of register 'f' are rotated one bit to the right through the carry flag. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. register f c register f c sleep syntax: [ label ] sleep operands: none operation: 00h wdt, 0 wdt prescaler, 1 to , 0 pd status affected: to , pd description: the power-down status bit, pd is cleared. time-out status bit, to is set. watchdog timer and its prescaler are cleared. the processor is put into sleep mode with the oscillator stopped. sublw subtract w from literal syntax: [ label ] sublw k operands: 0 k 255 operation: k - (w) ( w) status affected: c, dc, z description: the w register is subtracted (2?s complement method) from the eight-bit literal 'k'. the result is placed in the w register. subwf subtract w from f syntax: [ label ] subwf f,d operands: 0 f 127 d [0,1] operation: (f) - (w) ( destination) status affected: c, dc, z description: subtract (2?s complement method) w register from register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 76 ? 2003 microchip technology inc. swapf swap nibbles in f syntax: [ label ] swapf f,d operands: 0 f 127 d [0,1] operation: (f<3:0>) (destination<7:4>), (f<7:4>) (destination<3:0>) status affected: none description: the upper and lower nibbles of register 'f' are exchanged. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed in register 'f'. xorlw exclusive or literal with w syntax: [ label ] xorlw k operands: 0 k 255 operation: (w) .xor. k ( w) status affected: z description: the contents of the w register are xor?ed with the eight-bit literal 'k'. the result is placed in the w register. xorwf exclusive or w with f syntax: [ label ] xorwf f,d operands: 0 f 127 d [0,1] operation: (w) .xor. (f) ( destination) status affected: z description: exclusive or the contents of the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 77 pic12F629/675 11.0 development support the picmicro ? microcontrollers are supported with a full range of hardware and software development tools:  integrated development environment - mplab ? ide software  assemblers/compilers/linkers -mpasm tm assembler - mplab c17 and mplab c18 c compilers -mplink tm object linker/ mplib tm object librarian - mplab c30 c compiler - mplab asm30 assembler/linker/library  simulators - mplab sim software simulator - mplab dspic30 software simulator  emulators - mplab ice 2000 in-circuit emulator - mplab ice 4000 in-circuit emulator  in-circuit debugger - mplab icd 2  device programmers -pro mate ? ii universal device programmer - picstart ? plus development programmer  low cost demonstration boards - picdem tm 1 demonstration board - picdem.net tm demonstration board - picdem 2 plus demonstration board - picdem 3 demonstration board - picdem 17 demonstration board - picdem 18r demonstration board - picdem lin demonstration board - picdem usb demonstration board  evaluation kits -k ee l oq ? - picdem msc - microid ? -can - powersmart ? -analog 11.1 mplab integrated development environment software the mplab ide software brings an ease of software development previously unseen in the 8/16-bit micro- controller market. the mplab ide is a windows ? based application that contains:  an interface to debugging tools - simulator - programmer (sold separately) - emulator (sold separately) - in-circuit debugger (sold separately)  a full-featured editor with color coded context  a multiple project manager  customizable data windows with direct edit of contents  high level source code debugging  mouse over variable inspection  extensive on-line help the mplab ide allows you to:  edit your source files (either assembly or c)  one touch assemble (or compile) and download to picmicro emulator and simulator tools (automatically updates all project information)  debug using: - source files (assembly or c) - absolute listing file (mixed assembly and c) - machine code mplab ide supports multiple debugging tools in a single development paradigm, from the cost effective simulators, through low cost in-circuit debuggers, to full-featured emulators. this eliminates the learning curve when upgrading to tools with increasing flexibility and power. 11.2 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for all picmicro mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol ref- erence, absolute lst files that contains source lines and generated machine code and coff files for debugging. the mpasm assembler features include:  integration into mplab ide projects  user defined macros to streamline assembly code  conditional assembly for multi-purpose source files  directives that allow complete control over the assembly process .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 78 ? 2003 microchip technology inc. 11.3 mplab c17 and mplab c18 c compilers the mplab c17 and mplab c18 code development systems are complete ansi c compilers for microchip?s pic17cxxx and pic18cxxx family of microcontrollers. these compilers provide powerful integration capabilities, superior code optimization and ease of use not found with other compilers. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. 11.4 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler and the mplab c17 and mplab c18 c compilers. it can link relocatable objects from pre-compiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of pre-compiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/library features include:  efficient linking of single libraries instead of many smaller files  enhanced code maintainability by grouping related modules together  flexible creation of libraries with easy module listing, replacement, deletion and extraction 11.5 mplab c30 c compiler the mplab c30 c compiler is a full-featured, ansi compliant, optimizing compiler that translates standard ansi c programs into dspic30f assembly language source. the compiler also supports many command- line options and language extensions to take full advantage of the dspic30f device hardware capabili- ties, and afford fine control of the compiler code generator. mplab c30 is distributed with a complete ansi c standard library. all library functions have been vali- dated and conform to the ansi c library standard. the library includes functions for string manipulation, dynamic memory allocation, data conversion, time- keeping, and math functions (trigonometric, exponen- tial and hyperbolic). the compiler provides symbolic information for high level source debugging with the mplab ide. 11.6 mplab asm30 assembler, linker, and librarian mplab asm30 assembler produces relocatable machine code from symbolic assembly language for dspic30f devices. mplab c30 compiler uses the assembler to produce it?s object file. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. notable features of the assembler include:  support for the entire dspic30f instruction set  support for fixed-point and floating-point data  command line interface  rich directive set  flexible macro language  mplab ide compatibility 11.7 mplab sim software simulator the mplab sim software simulator allows code devel- opment in a pc hosted environment by simulating the picmicro series microcontrollers on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a file, or user defined key press, to any pin. the execu- tion can be performed in single-step, execute until break, or trace mode. the mplab sim simulator fully supports symbolic debugging using the mplab c17 and mplab c18 c compilers, as well as the mpasm assembler. the software simulator offers the flexibility to develop and debug code outside of the laboratory environment, making it an excellent, economical software development tool. 11.8 mplab sim30 software simulator the mplab sim30 software simulator allows code development in a pc hosted environment by simulating the dspic30f series microcontrollers on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a file, or user defined key press, to any of the pins. the mplab sim30 simulator fully supports symbolic debugging using the mplab c30 c compiler and mplab asm30 assembler. the simulator runs in either a command line mode for automated tasks, or from mplab ide. this high speed simulator is designed to debug, analyze and optimize time intensive dsp routines. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 79 pic12F629/675 11.9 mplab ice 2000 high performance universal in-circuit emulator the mplab ice 2000 universal in-circuit emulator is intended to provide the product development engineer with a complete microcontroller design tool set for picmicro microcontrollers. software control of the mplab ice 2000 in-circuit emulator is advanced by the mplab integrated development environment, which allows editing, building, downloading and source debugging from a single environment. the mplab ice 2000 is a full-featured emulator sys- tem with enhanced trace, trigger and data monitoring features. interchangeable processor modules allow the system to be easily reconfigured for emulation of differ- ent processors. the universal architecture of the mplab ice in-circuit emulator allows expansion to support new picmicro microcontrollers. the mplab ice 2000 in-circuit emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. the pc platform and microsoft ? windows 32-bit operating system were chosen to best make these features available in a simple, unified application. 11.10 mplab ice 4000 high performance universal in-circuit emulator the mplab ice 4000 universal in-circuit emulator is intended to provide the product development engineer with a complete microcontroller design tool set for high- end picmicro microcontrollers. software control of the mplab ice in-circuit emulator is provided by the mplab integrated development environment, which allows editing, building, downloading and source debugging from a single environment. the mplab icd 4000 is a premium emulator system, providing the features of mplab ice 2000, but with increased emulation memory and high speed perfor- mance for dspic30f and pic18xxxx devices. its advanced emulator features include complex triggering and timing, up to 2 mb of emulation memory, and the ability to view variables in real-time. the mplab ice 4000 in-circuit emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. the pc platform and microsoft windows 32-bit operating system were cho- sen to best make these features available in a simple, unified application. 11.11 mplab icd 2 in-circuit debugger microchip?s in-circuit debugger, mplab icd 2, is a powerful, low cost, run-time development tool, connecting to the host pc via an rs-232 or high speed usb interface. this tool is based on the flash picmicro mcus and can be used to develop for these and other picmicro microcontrollers. the mplab icd 2 utilizes the in-circuit debugging capability built into the flash devices. this feature, along with microchip?s in-circuit serial programming tm (icsp tm ) protocol, offers cost effective in-circuit flash debug- ging from the graphical user interface of the mplab integrated development environment. this enables a designer to develop and debug source code by setting breakpoints, single-stepping and watching variables, cpu status and peripheral registers. running at full speed enables testing hardware and applications in real-time. mplab icd 2 also serves as a development programmer for selected picmicro devices. 11.12 pro mate ii universal device programmer the pro mate ii is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features an lcd display for instructions and error messages and a modular detachable socket assembly to support various package types. in stand-alone mode, the pro mate ii device programmer can read, verify, and program picmicro devices without a pc connection. it can also set code protection in this mode. 11.13 picstart plus development programmer the picstart plus development programmer is an easy-to-use, low cost, prototype programmer. it con- nects to the pc via a com (rs-232) port. mplab integrated development environment software makes using the programmer simple and efficient. the picstart plus development programmer supports most picmicro devices up to 40 pins. larger pin count devices, such as the pic16c92x and pic17c76x, may be supported with an adapter socket. the picstart plus development programmer is ce compliant. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 80 ? 2003 microchip technology inc. 11.14 picdem 1 picmicro demonstration board the picdem 1 demonstration board demonstrates the capabilities of the pic16c5x (pic16c54 to pic16c58a), pic16c61, pic16c62x, pic16c71, pic16c8x, pic17c42, pic17c43 and pic17c44. all necessary hardware and software is included to run basic demo programs. the sample microcontrollers provided with the picdem 1 demonstration board can be programmed with a pro mate ii device program- mer, or a picstart plus development programmer. the picdem 1 demonstration board can be connected to the mplab ice in-circuit emulator for testing. a pro- totype area extends the circuitry for additional applica- tion components. features include an rs-232 interface, a potentiometer for simulated analog input, push button switches and eight leds. 11.15 picdem.net internet/ethernet demonstration board the picdem.net demonstration board is an internet/ ethernet demonstration board using the pic18f452 microcontroller and tcp/ip firmware. the board supports any 40-pin dip device that conforms to the standard pinout used by the pic16f877 or pic18c452. this kit features a user friendly tcp/ip stack, web server with html, a 24l256 serial eeprom for xmodem download to web pages into serial eeprom, icsp/mplab icd 2 interface con- nector, an ethernet interface, rs-232 interface, and a 16 x 2 lcd display. also included is the book and cd-rom ?tcp/ip lean, web servers for embedded systems,? by jeremy bentham 11.16 picdem 2 plus demonstration board the picdem 2 plus demonstration board supports many 18-, 28-, and 40-pin microcontrollers, including pic16f87x and pic18fxx2 devices. all the neces- sary hardware and software is included to run the dem- onstration programs. the sample microcontrollers provided with the picdem 2 demonstration board can be programmed with a pro mate ii device program- mer, picstart plus development programmer, or mplab icd 2 with a universal programmer adapter. the mplab icd 2 and mplab ice in-circuit emulators may also be used with the picdem 2 demonstration board to test firmware. a prototype area extends the circuitry for additional application components. some of the features include an rs-232 interface, a 2 x 16 lcd display, a piezo speaker, an on-board temperature sensor, four leds, and sample pic18f452 and pic16f877 flash microcontrollers. 11.17 picdem 3 pic16c92x demonstration board the picdem 3 demonstration board supports the pic16c923 and pic16c924 in the plcc package. all the necessary hardware and software is included to run the demonstration programs. 11.18 picdem 17 demonstration board the picdem 17 demonstration board is an evaluation board that demonstrates the capabilities of several microchip microcontrollers, including pic17c752, pic17c756a, pic17c762 and pic17c766. a pro- grammed sample is included. the pro mate ii device programmer, or the picstart plus development pro- grammer, can be used to reprogram the device for user tailored application development. the picdem 17 demonstration board supports program download and execution from external on-board flash memory. a generous prototype area is available for user hardware expansion. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 81 pic12F629/675 11.19 picdem 18r pic18c601/801 demonstration board the picdem 18r demonstration board serves to assist development of the pic18c601/801 family of microchip microcontrollers. it provides hardware implementation of both 8-bit multiplexed/de-multiplexed and 16-bit memory modes. the board includes 2 mb external flash memory and 128 kb sram memory, as well as serial eeprom, allowing access to the wide range of memory types supported by the pic18c601/801. 11.20 picdem lin pic16c43x demonstration board the powerful lin hardware and software kit includes a series of boards and three picmicro microcontrollers. the small footprint pic16c432 and pic16c433 are used as slaves in the lin communication and feature on-board lin transceivers. a pic16f874 flash microcontroller serves as the master. all three micro- controllers are programmed with firmware to provide lin bus communication. 11.21 pickit tm 1 flash starter kit a complete "development system in a box", the pickit flash starter kit includes a convenient multi-section board for programming, evaluation, and development of 8/14-pin flash pic ? microcontrollers. powered via usb, the board operates under a simple windows gui. the pickit 1 starter kit includes the user's guide (on cd rom), pickit 1 tutorial software and code for vari- ous applications. also included are mplab ? ide (inte- grated development environment) software, software and hardware "tips 'n tricks for 8-pin flash pic ? microcontrollers" handbook and a usb interface cable. supports all current 8/14-pin flash pic microcontrollers, as well as many future planned devices. 11.22 picdem usb pic16c7x5 demonstration board the picdem usb demonstration board shows off the capabilities of the pic16c745 and pic16c765 usb microcontrollers. this board provides the basis for future usb products. 11.23 evaluation and programming tools in addition to the picdem series of circuits, microchip has a line of evaluation kits and demonstration software for these products. k ee l oq evaluation and programming tools for microchip?s hcs secure data products  can developers kit for automotive network applications  analog design boards and filter design software  powersmart battery charging evaluation/ calibration kits irda ? development kit  microid development and rflab tm development software  seeval ? designer kit for memory evaluation and endurance calculations  picdem msc demo boards for switching mode power supply, high power ir driver, delta sigma adc, and flow rate sensor check the microchip web page and the latest product line card for the complete list of demonstration and evaluation kits. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 82 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 83 pic12F629/675 12.0 electrical specifications absolute maximum ratings? ambient temperature under bias................................................................................................. .......... -40 to +125c storage temperature ............................................................................................................ ............ -65c to +150c voltage on v dd with respect to v ss ..................................................................................................... -0.3 to +6.5v voltage on mclr with respect to vss ..................................................................................................-0.3 to +13.5v voltage on all other pins with respect to v ss ........................................................................... -0.3v to (v dd + 0.3v) total power dissipation (1) ............................................................................................................................... 800 mw maximum current out of v ss pin ..................................................................................................................... 300 ma maximum current into v dd pin ........................................................................................................................ 250 ma input clamp current, i ik (v i < 0 or v i > v dd ) ............................................................................................................... 20 ma output clamp current, i ok (vo < 0 or vo >v dd ) ......................................................................................................... 20 ma maximum output current sunk by any i/o pin..................................................................................... ............... 25 ma maximum output current sourced by any i/o pin .................................................................................. ............ 25 ma maximum current sunk by all gpio ............................................................................................... ................. 125 ma maximum current sourced all gpio ............................................................................................... ................. 125 ma note 1: power dissipation is calculated as follows: p dis = v dd x {i dd - i oh } + {(v dd -v oh ) x i oh } + (v o l x i ol ). ? notice : stresses above those listed under ?absolute maximum ratings? may cause permanent damage to the device. this is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operation listings of this specification is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. note: voltage spikes below v ss at the mclr pin, inducing currents greater than 80 ma, may cause latchup. thus, a series resistor of 50-100 ? should be used when applying a "low" level to the mclr pin, rather than pulling this pin directly to v ss . .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 84 ? 2003 microchip technology inc. figure 12-1: pic12F629/675 with a/d disabled voltage-frequency graph, -40c t a +125c figure 12-2: pic12f675 with a/d enabled voltage-frequency graph, -40c t a +125c 5.5 2.0 3.5 2.5 0 3.0 4.0 4.5 5.0 4 frequency (mhz) v dd (volts) note 1: the shaded region indicates the permissible combinations of voltage and frequency. 816 12 20 10 5.5 2.0 3.5 2.5 0 3.0 4.0 4.5 5.0 4 frequency (mhz) v dd (volts) note 1: the shaded region indicates the permissible combinations of voltage and frequency. 816 12 20 10 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 85 pic12F629/675 figure 12-3: pic12f675 with a/d enabled voltage-frequency graph, 0c t a +125c 5.5 2.0 3.5 2.5 0 3.0 4.0 4.5 5.0 4 frequency (mhz) v dd (volts) note 1: the shaded region indicates the permissible combinations of voltage and frequency. 816 12 20 10 2.2 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 86 ? 2003 microchip technology inc. 12.1 dc characteristics: pic12F629/675-i (industrial), pic12F629/675-e (extended) dc characteristics standard operating conditions (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. sym characteristic min typ? max units conditions d001 d001a d001b d001c d001d v dd supply voltage 2.0 2.2 2.5 3.0 4.5 ? ? ? ? ? 5.5 5.5 5.5 5.5 5.5 v v v v v f osc < = 4 mhz: pic12F629/675 with a/d off pic12f675 with a/d on, 0c to +125c pic12f675 with a/d on, -40c to +125c 4 mh z < f osc < = 10 mhz d002 v dr ram data retention voltage (1) 1.5* ? ? v device in sleep mode d003 v por v dd start voltage to ensure internal power-on reset signal ? v ss ? v see section on power-on reset for details d004 s vdd v dd rise rate to ensure internal power-on reset signal 0.05* ? ? v/ms see section on power-on reset for details d005 v bod ? 2.1 ? v * these parameters are characterized but not tested. ? data in "typ" column is at 5.0v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: this is the limit to which v dd can be lowered in sleep mode without losing ram data. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 87 pic12F629/675 12.2 dc characteristics: pic12F629/675-i (industrial) standard operating conditions (unless otherwise stated) operating temperature -40 c t a +85 c for industrial param no. device characteristics min typ? max units conditions v dd note d010 supply current (i dd ) ? 9 16 a 2.0 f osc = 32 khz lp oscillator mode ? 18 28 a 3.0 ? 35 54 a 5.0 d011 ? 110 150 a 2.0 f osc = 1 mhz xt oscillator mode ? 190 280 a 3.0 ? 330 450 a 5.0 d012 ? 220 280 a 2.0 f osc = 4 mhz xt oscillator mode ? 370 650 a 3.0 ? 0.6 1.4 ma 5.0 d013 ? 70 110 a 2.0 f osc = 1 mhz ec oscillator mode ? 140 250 a 3.0 ? 260 390 a 5.0 d014 ? 180 250 a 2.0 f osc = 4 mhz ec oscillator mode ? 320 470 a 3.0 ? 580 850 a 5.0 d015 ? 340 450 a 2.0 f osc = 4 mhz intosc mode ? 500 700 a 3.0 ? 0.8 1.1 ma 5.0 d016 ? 180 250 a 2.0 f osc = 4 mhz extrc mode ? 320 450 a 3.0 ? 580 800 a 5.0 d017 ? 2.1 2.95 ma 4.5 f osc = 20 mhz hs oscillator mode ? 2.4 3.0 ma 5.0 ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: the test conditions for all i dd measurements in active operation mode are: osc1 = external square wave, from rail to rail; all i/o pins tri-stated, pulled to v dd ; mclr = v dd ; wdt disabled. 2: the supply current is mainly a function of the operating voltage and frequency. other factors such as i/o pin loading and switching rate, oscillator type, internal code execution pattern, and temperature also have an impact on the current consumption. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 88 ? 2003 microchip technology inc. 12.3 dc characteristics: pic12F629/675-i (industrial) standard operating conditions (unless otherwise stated) operating temperature -40 c t a +85 c for industrial param no. device characteristics min typ? max units conditions v dd note d020 power-down base current (i pd ) ? 0.99 700 na 2.0 wdt, bod, comparators, v ref , and t1osc disabled ? 1.2 770 na 3.0 ? 2.9 995 na 5.0 d021 ? 0.3 1.5 a 2.0 wdt current (1) ? 1.8 3.5 a 3.0 ? 8.4 17 a 5.0 d022 ? 58 70 a 3.0 bod current (1) ? 109 130 a 5.0 d023 ? 3.3 6.5 a 2.0 comparator current (1) ? 6.1 8.5 a 3.0 ? 11.5 16 a 5.0 d024 ? 58 70 a 2.0 cv ref current (1) ? 85 100 a 3.0 ? 138 160 a 5.0 d025 ? 4.0 6.5 a 2.0 t1 o sc current (1) ? 4.6 7.0 a 3.0 ? 6.0 10.5 a 5.0 d026 ? 1.2 775 na 3.0 a/d current (1) ? 0.0022 1.0 a 5.0 ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: the peripheral current is the sum of the base i dd or i pd and the additional current consumed when this peripheral is enabled. the peripheral ? current can be determined by subtracting the base i dd or i pd current from this limit. max values should be used when calculating total current consumption. 2: the power-down current in sleep mode does not depend on the oscillator type. power-down current is measured with the part in sleep mode, with all i/o pins in hi-impedance state and tied to v dd . .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 89 pic12F629/675 12.4 dc characteristics: pic12F629/675-e (extended) standard operating conditions (unless otherwise stated) operating temperature -40 c t a +125 c for extended param no. device characteristics min typ? max units conditions v dd note d010e supply current (i dd ) ? 9 16 a 2.0 f osc = 32 khz lp oscillator mode ? 18 28 a 3.0 ? 35 54 a 5.0 d011e ? 110 150 a 2.0 f osc = 1 mhz xt oscillator mode ? 190 280 a 3.0 ? 330 450 a 5.0 d012e ? 220 280 a 2.0 f osc = 4 mhz xt oscillator mode ? 370 650 a 3.0 ? 0.6 1.4 ma 5.0 d013e ? 70 110 a 2.0 f osc = 1 mhz ec oscillator mode ? 140 250 a 3.0 ? 260 390 a 5.0 d014e ? 180 250 a 2.0 f osc = 4 mhz ec oscillator mode ? 320 470 a 3.0 ? 580 850 a 5.0 d015e ? 340 450 a 2.0 f osc = 4 mhz intosc mode ? 500 780 a 3.0 ? 0.8 1.1 ma 5.0 d016e ? 180 250 a 2.0 f osc = 4 mhz extrc mode ? 320 450 a 3.0 ? 580 800 a 5.0 d017e ? 2.1 2.95 ma 4.5 f osc = 20 mhz hs oscillator mode ? 2.4 3.0 ma 5.0 ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: the test conditions for all i dd measurements in active operation mode are: osc1 = external square wave, from rail to rail; all i/o pins tri-stated, pulled to v dd ; mclr = v dd ; wdt disabled. 2: the supply current is mainly a function of the operating voltage and frequency. other factors such as i/o pin loading and switching rate, oscillator type, internal code execution pattern, and temperature also have an impact on the current consumption. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 90 ? 2003 microchip technology inc. 12.5 dc characteristics: pic12F629/675-e (extended) standard operating conditions (unless otherwise stated) operating temperature -40 c t a +125 c for extended param no. device characteristics min typ? max units conditions v dd note d020e power-down base current (i pd ) ? 0.00099 3.5 a 2.0 wdt, bod, comparators, v ref , and t1osc disabled ? 0.0012 4.0 a 3.0 ? 0.0029 8.0 a 5.0 d021e ? 0.3 6.0 a 2.0 wdt current (1) ? 1.8 9.0 a 3.0 ? 8.4 20 a 5.0 d022e ? 58 70 a 3.0 bod current (1) ? 109 130 a 5.0 d023e ? 3.3 10 a 2.0 comparator current (1) ? 6.1 13 a 3.0 ? 11.5 24 a 5.0 d024e ? 58 70 a 2.0 cv ref current (1) ? 85 100 a 3.0 ? 138 165 a 5.0 d025e ? 4.0 10 a 2.0 t1 o sc current (1) ? 4.6 12 a 3.0 ? 6.0 20 a 5.0 d026e ? 0.0012 6.0 a 3.0 a/d current (1) ? 0.0022 8.5 a 5.0 ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: the peripheral current is the sum of the base i dd or i pd and the additional current consumed when this peripheral is enabled. the peripheral ? current can be determined by subtracting the base i dd or i pd current from this limit. max values should be used when calculating total current consumption. 2: the power-down current in sleep mode does not depend on the oscillator type. power-down current is measured with the part in sleep mode, with all i/o pins in hi-impedance state and tied to v dd . .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 91 pic12F629/675 12.6 dc characteristics: pic12F629/675-i (industrial), pic12F629/675-e (extended) dc characteristics standard operating conditions (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. sym characteristic min typ? max units conditions input low voltage v il i/o ports d030 with ttl buffer v ss ? 0.8 v 4.5v v dd 5.5v d030a v ss ? 0.15 v dd v otherwise d031 with schmitt trigger buffer v ss ? 0.2 v dd v entire range d032 mclr , osc1 (rc mode) v ss ? 0.2 v dd v d033 osc1 (xt and lp modes) v ss ? 0.3 v (note 1) d033a osc1 (hs mode) v ss ? 0.3 v dd v (note 1) input high voltage v ih i/o ports ? d040 d040a with ttl buffer 2.0 (0.25 v dd + 0.8) ? ? v dd v dd v v 4.5v v dd 5.5v otherwise d041 with schmitt trigger buffer 0.8 v dd ? v dd entire range d042 mclr 0.8 v dd ? v dd v d043 osc1 (xt and lp modes) 1.6 ? v dd v (note 1) d043a osc1 (hs mode) 0.7 v dd ? v dd v (note 1) d043b osc1 (rc mode) 0.9 v dd ? v dd v d070 i pur gpio weak pull-up current 50* 250 400* a v dd = 5.0v, v pin = v ss input leakage current (3) d060 i il i/o ports ? 0 . 1 1 a v ss v pin v dd , pin at hi-impedance d060a analog inputs ? 0 . 1 1 a v ss v pin v dd d060b v ref ? 0 . 1 1 a v ss v pin v dd d061 mclr (2) ? 0 . 1 5 a v ss v pin v dd d063 osc1 ? 0 . 1 5 a v ss v pin v dd , xt, hs and lp osc configuration output low voltage d080 v ol i/o ports ? ? 0.6 v i ol = 8.5 ma, v dd = 4.5v (ind.) d083 osc2/clkout (rc mode) ? ? 0.6 v i ol = 1.6 ma, v dd = 4.5v (ind.) i ol = 1.2 ma, v dd = 4.5v (ext.) output high voltage d090 v oh i/o ports v dd - 0.7 ? ? v i oh = -3.0 ma, v dd = 4.5v (ind.) d092 osc2/clkout (rc mode) v dd - 0.7 ? ? v i oh = -1.3 ma, v dd = 4.5v (ind.) i oh = -1.0 ma, v dd = 4.5v (ext.) * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: in rc oscillator configuration, the osc1/clkin pin is a schmitt trigger input. it is not recommended to use an external clock in rc mode. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current may be measured at different input voltages. 3: negative current is defined as current sourced by the pin. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 92 ? 2003 microchip technology inc. 12.7 dc characteristics: pic12F629/675-i (industrial), pic12F629/675-e (exte nded) (cont.) dc characteristics standard operating conditions (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. sym characteristic min typ? max units conditions capacitive loading specs on output pins d100 c osc2 osc2 pin ? ? 15* pf in xt, hs and lp modes when external clock is used to drive osc1 d101 c io all i/o pins ? ? 50* pf data eeprom memory d120 e d byte endurance 100k 1m ? e/w -40 c t a +85c d120a e d byte endurance 10k 100k ? e/w +85c t a +125c d121 v drw v dd for read/write v min ? 5.5 v using eecon to read/write v min = minimum operating voltage d122 t dew erase/write cycle time ? 5 6 ms d123 t retd characteristic retention 40 ? ? year provided no other specifications are violated d124 t ref number of total erase/write cycles before refresh (1) 1m 10m ? e/w -40 c t a +85c program flash memory d130 e p cell endurance 10k 100k ? e/w -40 c t a +85c d130a e d cell endurance 1k 10k ? e/w +85c t a +125c d131 v pr v dd for read v min ? 5.5 v v min = minimum operating voltage d132 v pew v dd for erase/write 4.5 ? 5.5 v d133 t pew erase/write cycle time ? 2 2.5 ms d134 t retd characteristic retention 40 ? ? year provided no other specifications are violated * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: see section 8.5.1 for additional information. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 93 pic12F629/675 12.8 timing parameter symbology the timing parameter symbols have been created with one of the following formats: figure 12-4: load conditions 1. tpps2pps 2. tpps t f frequency ttime lowercase letters (pp) and their meanings: pp cc ccp1 osc osc1 ck clkout rd rd cs cs rw rd or wr di sdi sc sck do sdo ss ss dt data in t0 t0cki io i/o port t1 t1cki mc mclr wr wr uppercase letters and their meanings: s f fall p period hhigh rrise i invalid (hi-impedance) v valid llow z hi-impedance v dd /2 c l r l pin pin v ss v ss c l r l =464 ? c l = 50 pf for all pins 15 pf for osc2 output load condition 1 load condition 2 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 94 ? 2003 microchip technology inc. 12.9 ac characteristics: pic12F629/675 (industrial, extended) figure 12-5: external clock timing table 12-1: external clock timing requirements param no. sym characteristic min typ? max units conditions f osc external clkin frequency (1) dc ? 37 khz lp osc mode dc ? 4 mhz xt mode dc ? 20 mhz hs mode dc ? 20 mhz ec mode oscillator frequency (1) 5 ? 37 khz lp osc mode ? 4 ? mhz intosc mode dc ? 4 mhz rc osc mode 0.1 ? 4 mhz xt osc mode 1 ? 20 mhz hs osc mode 1 t osc external clkin period (1) 27 ? s lp osc mode 50 ? ns hs osc mode 50 ? ns ec osc mode 250 ? ns xt osc mode oscillator period (1) 27 200 s lp osc mode ? 250 ? ns intosc mode 250 ? ? ns rc osc mode 250 ? 10,000 ns xt osc mode 50 ? 1,000 ns hs osc mode 2 t cy instruction cycle time (1) 200 t cy dc ns t cy = 4/f osc 3 to s l , to s h external clkin (osc1) high external clkin low 2* ? ? s lp oscillator, t osc l/h duty cycle 20* ? ? ns hs oscillator, t osc l/h duty cycle 100 * ? ? ns xt oscillator, t osc l/h duty cycle 4 to s r , to s f external clkin rise external clkin fall ? ? 50* ns lp oscillator ? ? 25* ns xt oscillator ? ? 15* ns hs oscillator * these parameters are characterized but not tested. ? data in ?typ? column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: instruction cycle period (t cy ) equals four times the input oscillator time-base period. all specified values are based on characterization data for that particular oscillator type under standard operating conditions with the device executing code. exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. all devices are tested to operate at ?min? values with an external clock applied to osc1 pin. when an external clock input is used, the ?max? cycle time limit is ?dc? (no clock) for all devices. osc1 clkout q4 q1 q2 q3 q4 q1 1 2 3 3 4 4 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 95 pic12F629/675 table 12-2: precision internal oscillator parameters param no. sym characteristic freq tolerance min typ? max units conditions f10 f osc internal calibrated intosc frequency 1 3.96 4.00 4.04 mhz v dd = 3.5v, 25 c 2 3.92 4.00 4.08 mhz 2.5v v dd 5.5v 0 c t a +85 c 5 3.80 4.00 4.20 mhz 2.0v v dd 5.5v -40 c t a +85 c (ind) -40 c t a +125 c (ext) f14 t iosc st oscillator wake-up from sleep start-up time* ? ? 6 8 s v dd = 2.0v, -40 c to +85 c ? ? 4 6 s v dd = 3.0v, -40 c to +85 c ? ? 3 5 s v dd = 5.0v, -40 c to +85 c * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 96 ? 2003 microchip technology inc. figure 12-6: clkout and i/o timing table 12-3: clkout and i/o timing requirements osc1 clkout i/o pin (input) i/o pin (output) q4 q1 q2 q3 10 13 14 17 20, 21 22 23 19 18 15 11 12 16 old value new value param no. sym characteristic min typ? max units conditions 10 to s h 2 c k l osc1 to clk- out ? 75 200 ns (note 1) 11 to s h 2 c k h osc1 to clk- out ? 75 200 ns (note 1) 12 tc k r clkout rise time ? 35 100 ns (note 1) 13 tc k f clkout fall time ? 35 100 ns (note 1) 14 tckl2iov clkout to port out valid ? ? 20 ns (note 1) 15 tiov2ckh port in valid before clkout t osc + 200 ns ? ? ns (note 1) 16 tc k h 2 i o i port in hold after clkout 0 ? ? ns (note 1) 17 tosh2iov osc1 (q1 cycle) to port out valid ? 50 150 * ns ? ? 300 ns 18 tosh2ioi osc1 (q2 cycle) to port input invalid (i/o in hold time) 100 ? ? ns 19 tiov2osh port input valid to osc1 (i/o in setup time) 0 ? ? ns 20 tior port output rise time ? 10 40 ns 21 tiof port output fall time ? 10 40 ns 22 tinp int pin high or low time 25 ? ? ns 23 trbp gpio change int high or low time t cy ? ? ns * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. note 1: measurements are taken in rc mode where clkout output is 4xt osc . .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 97 pic12F629/675 figure 12-7: reset, watchdog timer, oscillator start-up timer and power-up timer timing figure 12-8: brown-out detect timing and characteristics v dd mclr internal por pwrt time-out osc time-out internal reset watchdog timer reset 33 32 30 31 34 i/o pins 34 b vdd reset (due to bod) v dd (device in brown-out detect) (device not in brown-out detect) 72 ms time-out (1) 35 note 1: 72 ms delay only if pwrte bit in configuration word is programmed to ?0?. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 98 ? 2003 microchip technology inc. table 12-4: reset, watchdog timer, oscillator start-up timer, power-up timer, and brown-out detect requirements param no. sym characteristic min typ? max units conditions 30 t mc l mclr pulse width (low) 2 tbd ? tbd ? tbd s ms v dd = 5v, -40c to +85c extended temperature 31 t wdt watchdog timer time-out period (no prescaler) 10 10 17 17 25 30 ms ms v dd = 5v, -40c to +85c extended temperature 32 t ost oscillation start-up timer period ? 1024t osc ? ? t osc = osc1 period 33* t pwrt power-up timer period 28* tbd 72 tbd 132* tbd ms ms v dd = 5v, -40c to +85c extended temperature 34 t ioz i/o hi-impedance from mclr low or watchdog timer reset ? ? 2.0 s b vdd brown-out detect voltage 2.025 ? 2.175 v brown-out hysteresis tbd ? ? ? 35 t bod brown-out detect pulse width 100* ? ? s v dd b vdd (d005) * these parameters are characterized but not tested. ? data in ?typ? column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 99 pic12F629/675 figure 12-9: timer0 and timer1 external clock timings table 12-5: timer0 and timer1 external clock requirements t0cki t1cki 40 41 42 45 46 47 48 tmr0 or tmr1 param no. sym characteristic min typ? max units conditions 40* tt0h t0cki high pulse width no prescaler 0.5 t cy + 20 ? ? ns with prescaler 10 ? ? ns 41* tt0l t0cki low pulse width no prescaler 0.5 t cy + 20 ? ? ns with prescaler 10 ? ? ns 42* tt0p t0cki period greater of: 20 or t cy + 40 n ? ? ns n = prescale value (2, 4, ..., 256) 45* tt1h t1cki high time synchronous, no prescaler 0.5 t cy + 20 ? ? ns synchronous, with prescaler 15 ? ? ns asynchronous 30 ? ? ns 46* tt1l t1cki low time synchronous, no prescaler 0.5 t cy + 20 ? ? ns synchronous, with prescaler 15 ? ? ns asynchronous 30 ? ? ns 47* tt1p t1cki input period synchronous greater of: 30 or t cy + 40 n ? ? ns n = prescale value (1, 2, 4, 8) asynchronous 60 ? ? ns ft1 timer1 oscillator input frequency range (oscillator enabled by setting bit t1oscen) dc ? 200* khz 48 tckeztmr1 delay from external clock edge to timer increment 2 t osc * ? 7 t osc * ? * these parameters are characterized but not tested. ? data in ?typ? column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 100 ? 2003 microchip technology inc. table 12-6: comparator specifications table 12-7: comparator voltage reference specifications comparator specifications standard operating conditions -40c to +125c (unless otherwise stated) sym characteristics min typ max units comments v os input offset voltage ? 5.0 10 mv v cm input common mode voltage 0 ? v dd - 1.5 v c mrr common mode rejection ratio +55* ? ? db t rt response time (1) ? 150 400* ns t mc 2 co v comparator mode change to output valid ? ? 10* s * these parameters are characterized but not tested. note 1: response time measured with one comparator input at (v dd - 1.5)/2 while the other input transitions from v ss to v dd - 1.5v. voltage reference specifications standard operating conditions -40c to +125c (unless otherwise stated) sym characteristics min typ max units comments resolution ? ? v dd /24* v dd /32 ? ? lsb lsb low range (vrr = 1) high range (vrr = 0) absolute accuracy ? ? ? ? 1/2 1/2* lsb lsb low range (vrr = 1) high range (vrr = 0) unit resistor value (r) ? 2k* ? ? settling time (1) ? ? 10* s * these parameters are characterized but not tested. note 1: settling time measured while vrr = 1 and vr<3:0> transitions from 0000 to 1111 . .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 101 pic12F629/675 table 12-8: pic12f675 a/d converter characteristics : param no. sym characteristic min typ? max units conditions a01 n r resolution ? ? 10 bits bit a02 e abs total absolute error* ? ? 1 lsb v ref = 5.0v a03 e il integral error ? ? 1 lsb v ref = 5.0v a04 e dl differential error ? ? 1 lsb no missing codes to 10 bits v ref = 5.0v a05 e fs full scale range 2.2* ? 5.5* v a06 e off offset error ? ? 1 lsb v ref = 5.0v a07 e gn gain error ? ? 1 lsb v ref = 5.0v a10 ? monotonicity ? guaranteed (3) ? ? v ss v ain v ref + a20 a20a v ref reference voltage 2.0 2.5 ? ? v dd + 0.3 v absolute minimum to ensure 10-bit accuracy a21 v ref reference v high (v dd or v ref ) v ss ? v dd v a25 v ain analog input voltage v ss ? v ref v a30 z ain recommended impedance of analog voltage source ? ? 10 k ? a50 i ref v ref input current (2) 10 ? ? ? 1000 10 a a during v ain acquisition. based on differential of v hold to v ain . during a/d conversion cycle. * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: when a/d is off, it will not consume any current other than leakage current. the power-down current spec includes any such leakage from the a/d module. 2: v ref current is from external v ref or v dd pin, whichever is selected as reference input. 3: the a/d conversion result never decreases with an increase in the input voltage and has no missing codes. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 102 ? 2003 microchip technology inc. figure 12-10: pic12f675 a/d conversion timing (normal mode) table 12-9: pic12f675 a/d conversion requirements 131 130 132 bsf adcon0, go q4 a/d clk a/d data adres adif go sample old_data sampling stopped done new_data 987 3210 note 1: if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. 1 t cy 6 134 (t osc /2) (1) 1 t cy param no. sym characteristic min typ? max units conditions 130 t ad a/d clock period 1.6 ? ? s t osc based, v ref 3.0v 3.0* ? ? s t osc based, v ref full range 130 t ad a/d internal rc oscillator period 3.0* 6.0 9.0* s adcs<1:0> = 11 (rc mode) at v dd = 2.5v 2.0* 4.0 6.0* s at v dd = 5.0v 131 t cnv conversion time (not including acquisition time) (1) ? 11 ? t ad set go bit to new data in a/d result register 132 t acq acquisition time (note 2) 5* 11.5 ? ? ? s s the minimum time is the amplifier settling time. this may be used if the ?new? input voltage has not changed by more than 1 lsb (i.e., 4.1 mv @ 4.096v) from the last sampled voltage (as stored on c hold ). 134 t go q4 to a/d clock start ? t osc /2 ? ? if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: adres register may be read on the following t cy cycle. 2: see section 7.1 for minimum conditions. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 103 pic12F629/675 figure 12-11: pic12f675 a/d conversion timing (sleep mode) table 12-10: pic12f675 a/d conversion requirements (sleep mode) param no. sym characteristic min typ? max units conditions 130 t ad a/d clock period 1.6 ? ? s v ref 3.0v 3.0* ? ? s v ref full range 130 t ad a/d internal rc oscillator period 3.0* 6.0 9.0* s adcs<1:0> = 11 (rc mode) at v dd = 2.5v 2.0* 4.0 6.0* s at v dd = 5.0v 131 t cnv conversion time (not including acquisition time) (1) ? 11 ? t ad 132 t acq acquisition time (note 2) 5* 11.5 ? ? ? s s the minimum time is the amplifier settling time. this may be used if the ?new? input voltage has not changed by more than 1 lsb (i.e., 4.1 mv @ 4.096v) from the last sampled voltage (as stored on c hold ). 134 t go q4 to a/d clock start ? t osc /2 + t cy ? ? if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. * these parameters are characterized but not tested. ? data in ?typ? column is at 5.0v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: adres register may be read on the following t cy cycle. 2: see section 7.1 for minimum conditions. 131 130 bsf adcon0, go q4 a/d clk a/d data adres adif go sample old_data sampling stopped done new_data 973210 note 1: if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. 134 6 8 132 1 t cy (t osc /2 + t cy ) (1) 1 t cy .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 104 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 105 pic12F629/675 13.0 dc and ac characteristics graphs and tables the graphs and tables provided in this section are for design guidance and are not tested . in some graphs or tables, the data presented are outside specified operating range (i.e., outside specified v dd range). this is for information only and devices are ensured to operate properly only within the specified range. the data presented in this section is a statistical summary of data collected on units from different lots over a period of time and matrix samples. 'typical' represents the mean of the distribution at 25c. 'max' or 'min' represents (mean + 3 ) or (mean - 3 ) respectively, where is standard deviation, over the whole temperature range. figure 13-1: typical i pd vs. v dd over temp (-40c to +25c) figure 13-2: typical i pd vs. v dd over temp (+85c) typical baseline i pd 0.0e+00 1.0e-09 2.0e-09 3.0e-09 4.0e-09 5.0e-09 6.0e-09 2 2.5 3 3.5 4 4.5 5 5.5 v dd (v) i pd (a) -40 0 25 typical baseline i pd 0.0e+00 5.0e-08 1.0e-07 1.5e-07 2.0e-07 2.5e-07 3.0e-07 3.5e-07 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 v dd (v) i pd (a) 85 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 106 ? 2003 microchip technology inc. figure 13-3: typical i pd vs. v dd over temp (+125c) figure 13-4: maximum i pd vs. v dd over temp (-40c to +25c) typical baseline i pd 0.0e+00 5.0e-07 1.0e-06 1.5e-06 2.0e-06 2.5e-06 3.0e-06 3.5e-06 4.0e-06 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 v dd (v) i pd (a) 125 maximum baseline i pd 0.0e+00 1.0e-08 2.0e-08 3.0e-08 4.0e-08 5.0e-08 6.0e-08 7.0e-08 8.0e-08 9.0e-08 1.0e-07 22.533.544.555.5 v dd (v) i pd ( a ) -40 0 25 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 107 pic12F629/675 figure 13-5: maximum i pd vs. v dd over temp (+85c) figure 13-6: maximum i pd vs. v dd over temp (+125c) maximum baseline i pd 0.0e+00 1.0e-07 2.0e-07 3.0e-07 4.0e-07 5.0e-07 6.0e-07 7.0e-07 8.0e-07 9.0e-07 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 v dd (v) i pd (a) 85 maximum baseline i pd 0.0e+00 1.0e-06 2.0e-06 3.0e-06 4.0e-06 5.0e-06 6.0e-06 7.0e-06 8.0e-06 9.0e-06 2.02.53.03.54.04.55.05.5 v dd (v) i pd (a) 125 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 108 ? 2003 microchip technology inc. figure 13-7: typical i pd with bod enabled vs. v dd over temp (-40c to +125c) figure 13-8: typical i pd with cmp enabled vs. v dd over temp (-40c to +125c) typical bod i pd 50 60 70 80 90 100 110 120 130 3 3.5 4 4.5 5 5.5 v d d (v) i pd (ua) -40 0 25 85 125 typical comparator i pd 0.0e+00 2.0e-06 4.0e-06 6.0e-06 8.0e-06 1.0e-05 1.2e-05 1.4e-05 1.6e-05 1.8e-05 2.02.53.03.54.04.55.05.5 v dd (v) i pd (a) -40 0 25 85 125 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 109 pic12F629/675 figure 13-9: typical i pd with a/d enabled vs. v dd over temp (-40c to +25c) figure 13-10: typical i pd with a/d enabled vs. v dd over temp (+85c) t y pical a/d i pd 0.0e+00 5.0e-10 1.0e-09 1.5e-09 2.0e-09 2.5e-09 3.0e-09 3.5e-09 4.0e-09 4.5e-09 5.0e-09 2 2.5 3 3.5 4 4.5 5 5.5 v dd (v) i pd (a) -40 0 25 typical a/d i pd 0.0e+00 5.0e-08 1.0e-07 1.5e-07 2.0e-07 2.5e-07 3.0e-07 3.5e-07 2 2.5 3 3.5 4 4.5 5 5.5 v dd (v) i pd ( a ) 85 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 110 ? 2003 microchip technology inc. figure 13-11: typical i pd with a/d enabled vs. v dd over temp (+125c) figure 13-12: typical i pd with t1 osc enabled vs. v dd over temp (-40c to +125c), 32 khz, c1 and c2=50 pf) typical a/d i pd 0.0e+00 5.0e-07 1.0e-06 1.5e-06 2.0e-06 2.5e-06 3.0e-06 3.5e-06 22.533.544.555.5 v d d (v) i pd (a) 125 typical t1 i pd 0.00e+00 2.00e-06 4.00e-06 6.00e-06 8.00e-06 1.00e-05 1.20e-05 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 v d d (v) i pd (a) -40 0 25 85 125 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 111 pic12F629/675 figure 13-13: typical i pd with cv ref enabled vs. v dd over temp (-40c to +125c) figure 13-14: typical i pd with wdt enabled vs. v dd over temp (-40c to +125c) t y pical cv ref i pd 40 60 80 100 120 140 160 2 2.5 3 3.5 4 4.5 5 5.5 v d d (v) i pd (ua) -40 0 25 85 125 typical wdt i pd 0 2 4 6 8 10 12 14 16 2 2.5 3 3.5 4 4.5 5 5.5 v dd ( v ) i pd (ua) -40 0 25 85 125 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 112 ? 2003 microchip technology inc. figure 13-15: maximum and minimum intosc freq vs. temperature with 0.1 f and 0.01 f decoupling (v dd = 3.5v) figure 13-16: maximum and minimum intosc freq vs. v dd with 0.1 f and 0.01 f decoupling (+25c) internal oscillator frequency vs temperature 3.80e+06 3.85e+06 3.90e+06 3.95e+06 4.00e+06 4.05e+06 4.10e+06 4.15e+06 4.20e+06 -40c 0c 25c 85c 125c temperature (c) frequency (hz) -3sigma average +3sigma internal oscillator frequency vs v dd 3.80e+06 3.85e+06 3.90e+06 3.95e+06 4.00e+06 4.05e+06 4.10e+06 4.15e+06 4.20e+06 2.0v 2.5v 3.0v 3.5v 4.0v 4.5v 5.0v 5.5v v dd (v) fre q uenc y ( hz ) -3sigma average +3sigma .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 113 pic12F629/675 figure 13-17: typical wdt period vs. v dd (-40 c to +125 c) wdt time-out 0 5 10 15 20 25 30 35 40 45 50 2 2.5 3 3.5 4 4.5 5 5.5 v dd (v) time (ms) -40 0 25 85 125 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 114 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 115 pic12F629/675 14.0 packaging information 14.1 package marking information xxxxxnnn 8-lead pdip (skinny dip) example xxxxxxxx yyww /017 12F629-i 0215 xxxxyyww 8-lead soic xxxxxxxx nnn /0215 example 12F629-e 017 8-lead dfn-s xxxxxxx nnn xxxxxxx xxyyww -e/021 017 12F629 0215 example legend: xx...x customer specific information* y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code note : in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line thus limiting the number of available characters for customer specific information. * standard picmicro device marking consists of microchip part number, year code, week code, and traceability code. for picmicro device marking beyond this, certain price adders apply. please check with your microchip sales office. for qtp devices, any special marking adders are included in qtp price. .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 116 ? 2003 microchip technology inc. 14.2 package details the following sections give the technical details of the packages. 8-lead plastic dual in-line (p) ? 300 mil (pdip) b1 b a1 a l a2 p e eb c e1 n d 1 2 units inches* millimeters dimension limits min nom max min nom max number of pins n 88 pitch p .100 2.54 top to seating plane a .140 .155 .170 3.56 3.94 4.32 molded package thickness a2 .115 .130 .145 2.92 3.30 3.68 base to seating plane a1 .015 0.38 shoulder to shoulder width e .300 .313 .325 7.62 7.94 8.26 molded package width e1 .240 .250 .260 6.10 6.35 6.60 overall length d .360 .373 .385 9.14 9.46 9.78 tip to seating plane l .125 .130 .135 3.18 3.30 3.43 lead thickness c .008 .012 .015 0.20 0.29 0.38 upper lead width b1 .045 .058 .070 1.14 1.46 1.78 lower lead width b .014 .018 .022 0.36 0.46 0.56 overall row spacing eb .310 .370 .430 7.87 9.40 10.92 mold draft angle top 5 10 15 5 10 15 mold draft angle bottom 5 10 15 5 10 15 * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed jedec equivalent: ms-001 drawing no. c04-018 .010? (0.254mm) per side. significant characteristic .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 117 pic12F629/675 8-lead plastic small outline (sn) ? narrow, 150 mil (soic) foot angle 048048 15 12 0 15 12 0 mold draft angle bottom 15 12 0 15 12 0 mold draft angle top 0.51 0.42 0.33 .020 .017 .013 b lead width 0.25 0.23 0.20 .010 .009 .008 c lead thickness 0.76 0.62 0.48 .030 .025 .019 l foot length 0.51 0.38 0.25 .020 .015 .010 h chamfer distance 5.00 4.90 4.80 .197 .193 .189 d overall length 3.99 3.91 3.71 .157 .154 .146 e1 molded package width 6.20 6.02 5.79 .244 .237 .228 e overall width 0.25 0.18 0.10 .010 .007 .004 a1 standoff 1.55 1.42 1.32 .061 .056 .052 a2 molded package thickness 1.75 1.55 1.35 .069 .061 .053 a overall height 1.27 .050 p pitch 8 8 n number of pins max nom min max nom min dimension limits millimeters inches* units 2 1 d n p b e e1 h l c 45 a2 a a1 * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per side. jedec equivalent: ms-012 drawing no. c04-057 significant characteristic .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 118 ? 2003 microchip technology inc. 8-lead plastic dual flat no lead package (mf) 6x5 mm body (dfn-s) nom .050 bsc inches .194 bsc .184 bsc .226 bsc .236 bsc .008 ref. d overall width jedec equivalent: pending notes: drawing no. c04-113 molded package width lead width *controlling parameter mold draft angle top tie bar width lead length r b l d1 .014 .020 dimension limits molded package thickness pitch overall height overall length molded package length base thickness standoff number of pins a3 e1 e a2 a1 a .000 units n p min top view 12 a2 a 5.99 bsc .019 12 .030 .014 .016 .024 0.35 0.50 .356 0.40 0.60 5.74 bsc 12 0.47 0.75 millimeters* .039 .002 .031 .026 .0004 .033 0.00 8 max min 1.27 bsc 0.20 ref. 4.92 bsc 4.67 bsc 0.85 0.01 0.65 0.80 0.05 1.00 max nom 8 bottom view n e e1 pin 1 p b exposed pad length e2 exposed pad width d2 .085 .091 .097 2.16 2.31 2.46 .152 .158 .163 3.85 4.00 4.15 exposed metal pads d2 e2 a1 a3 l id d1 d r dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per si de. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 119 pic12F629/675 8-lead plastic dual flat no lead package (mf) 6x5 mm body (dfn-s) land pattern and solder mask l m m b solder mask p package edge pad width *controlling parameter drawing no. c04-2113 b .014 .016 .019 0.35 0.40 0.47 pitch max units dimension limits p inches .050 bsc min nom max millimeters* min 1.27 bsc nom pad length pad to solder mask l .020 .024 .030 0.50 0.60 0.75 m .005 .006 0.13 0.15 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 120 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 121 pic12F629/675 appendix a: data sheet revision history revision a this is a new data sheet. revision b added characterization graphs. updated specifications. added notes to indicate microchip programmers maintain all calibration bits to factory settings and the pic12f675 ansel register must be initialized to configure pins as digital i/o. updated mlf-s package name to dfn-s. appendix b: device differences the differences between the pic12F629/675 devices listed in this data sheet are shown in table b-1. table b-1: device differences feature pic12F629 pic12f675 a/d no yes .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 122 ? 2003 microchip technology inc. appendix c: device migrations this section is intended to describe the functional and electrical specification differences when migrating between functionally similar devices (such as from a pic16c74a to a pic16c74b). not applicable appendix d: migrating from other picmicro ? devices this discusses some of the issues in migrating from other picmicro devices to the pic12f6xx family of devices. d.1 pic12c67x to pic12f6xx table 1: feature comparison feature pic12c67x pic12f6xx max operating speed 10 mhz 20 mhz max program memory 2048 bytes 1024 bytes a/d resolution 8-bit 10-bit data eeprom 16 bytes 64 bytes oscillator modes 5 8 brown-out detect n y internal pull-ups gp0/1/3 gp0/1/2/4/5 interrupt-on-change gp0/1/3 gp0/1/2/3/4/5 comparator n y note: this device has been designed to perform to the parameters of its data sheet. it has been tested to an electrical specification designed to determine its conformance with these parameters. due to process differences in the manufacture of this device, this device may have different performance characteristics than its earlier version. these differences may cause this device to perform differently in your application than the earlier version of this device. .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 123 pic12F629/675 index a a/d ...................................................................................... 41 acquisition requirements ........................................... 45 block diagram............................................................. 41 calculating acquisition time....................................... 45 configuration and operation....................................... 41 effects of a reset ..................................................... 46 internal sampling switch (rss) impedance ................ 45 operation during sleep ............................................ 46 pic12f675 converter characteristics ...................... 101 source impedance...................................................... 45 summary of registers ................................................ 46 absolute maximum ratings ................................................ 83 ac characteristics industrial and extended .............................................. 94 additional pin functions ..................................................... 19 interrupt-on-change.................................................... 21 weak pull-up............................................................... 19 analog input connection considerations............................ 38 analog-to-digital converter. see a/d assembler mpasm assembler..................................................... 77 b block diagram tmr0/wdt prescaler................................................. 27 block diagrams analog input mode...................................................... 38 analog input model ..................................................... 45 comparator output ..................................................... 38 comparator voltage reference .................................. 39 gp0 and gp1 pins...................................................... 22 gp2............................................................................. 23 gp3............................................................................. 23 gp4............................................................................. 24 gp5............................................................................. 24 on-chip reset circuit ................................................. 55 rc oscillator mode..................................................... 54 timer1......................................................................... 30 watchdog timer.......................................................... 65 brown-out associated registers .................................................. 58 brown-out detect (bod) ..................................................... 57 brown-out detect timing and characteristics..................... 97 c c compilers mplab c17 ................................................................ 78 mplab c18 ................................................................ 78 mplab c30 ................................................................ 78 calibrated internal rc frequencies.................................... 95 clkout ............................................................................. 54 code examples changing prescaler .................................................... 29 data eeprom read .................................................. 49 data eeprom write .................................................. 49 initializing gpio .......................................................... 19 saving status and w registers in ram ................. 64 write verify ................................................................. 49 code protection .................................................................. 67 comparator ......................................................................... 35 associated registers .................................................. 40 configuration............................................................... 37 effects of a reset ..................................................... 39 i/o operating modes................................................... 37 interrupts..................................................................... 40 operation.................................................................... 36 operation during sleep............................................ 39 output......................................................................... 38 reference ................................................................... 39 response time .......................................................... 39 comparator specifications................................................ 100 comparator voltage reference specifications................. 100 configuration bits ............................................................... 52 configuring the voltage reference..................................... 39 crystal operation................................................................ 53 d data eeprom memory associated registers/bits........................................... 50 code protection.......................................................... 50 eeadr register......................................................... 47 eecon1 register ...................................................... 47 eecon2 register ...................................................... 47 eedata register....................................................... 47 data memory organization................................................... 7 dc characteristics extended and industrial.............................................. 91 industrial ..................................................................... 86 demonstration boards picdem 1................................................................... 80 picdem 17................................................................. 80 picdem 18r pic18c601/801 ................................... 81 picdem 2 plus........................................................... 80 picdem 3 pic16c92x............................................... 80 picdem lin pic16c43x ........................................... 81 picdem usb pic16c7x5 ......................................... 81 picdem.net internet/ethernet.................................... 80 development support ......................................................... 77 device differences............................................................ 121 device migrations ............................................................. 122 device overview................................................................... 5 e eeprom data memory reading ...................................................................... 49 spurious write ............................................................ 49 write verify ................................................................. 49 writing ........................................................................ 49 electrical specifications ...................................................... 83 errata .................................................................................... 3 evaluation and programming tools.................................... 81 f firmware instructions ......................................................... 69 g general purpose register file ............................................. 7 gpio associated registers.................................................. 25 gpio port ........................................................................... 19 gpio, trisio registers..................................................... 19 i id locations........................................................................ 67 in-circuit debugger............................................................. 67 in-circuit serial programming............................................. 67 indirect addressing, indf and fsr registers ................... 18 instruction format............................................................... 69 instruction set..................................................................... 69 addlw....................................................................... 71 addwf ...................................................................... 71 andlw....................................................................... 71 andwf ...................................................................... 71 bcf ............................................................................ 71 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 124 ? 2003 microchip technology inc. bsf ............................................................................. 71 btfsc ........................................................................ 71 btfss ........................................................................ 71 call ........................................................................... 72 clrf........................................................................... 72 clrw ......................................................................... 72 clrwdt..................................................................... 72 comf ......................................................................... 72 decf .......................................................................... 72 decfsz...................................................................... 73 goto ......................................................................... 73 incf............................................................................ 73 incfsz ....................................................................... 73 iorlw ........................................................................ 73 iorwf ........................................................................ 73 movf.......................................................................... 74 movlw ...................................................................... 74 movwf ...................................................................... 74 nop ............................................................................ 74 retfie ....................................................................... 74 retlw ....................................................................... 74 return ..................................................................... 75 rlf ............................................................................. 75 rrf............................................................................. 75 sleep ........................................................................ 75 sublw ....................................................................... 75 subwf ....................................................................... 75 swapf ....................................................................... 76 xorlw ....................................................................... 76 xorwf....................................................................... 76 summary table........................................................... 70 internal 4 mhz oscillator..................................................... 54 internal sampling switch (rss) impedance ........................ 45 interrupts ............................................................................. 61 a/d converter ............................................................. 63 comparator ................................................................. 63 context saving............................................................ 64 gp2/int ...................................................................... 63 gpio ........................................................................... 63 summary of registers ................................................ 64 tmr0 .......................................................................... 63 m mclr .................................................................................. 56 memory organization data eeprom memory .............................................. 47 migrating from other picmicro devices ............................ 122 mplab asm30 assembler, linker, librarian ..................... 78 mplab icd 2 in-circuit debugger...................................... 79 mplab ice 2000 high performance universal in-circuit emulator .............................................................. 79 mplab ice 4000 high performance universal in-circuit emulator .............................................................. 79 mplab integrated development environment software .............................................................................. 77 mplink object linker/mplib object librarian .................. 78 o opcode field descriptions ............................................... 69 oscillator configurations ..................................................... 53 oscillator start-up timer (ost) .......................................... 56 p packaging ......................................................................... 115 details ....................................................................... 116 marking ..................................................................... 115 pcl and pclath ............................................................... 17 computed goto ........................................................ 17 stack........................................................................... 17 pickit 1 flash starter kit.................................................. 81 picstart plus development programmer....................... 79 pin descriptions and diagrams .......................................... 22 pinout descriptions pic12F629 ................................................................... 6 pic12f675 ................................................................... 6 power control/status register (pcon).............................. 57 power-down mode (sleep) .............................................. 66 power-on reset (por)....................................................... 56 power-up timer (pwrt) .................................................... 56 prescaler............................................................................. 29 switching prescaler assignment ................................ 29 pro mate ii universal device programmer ..................... 79 program memory organization............................................. 7 programming, device instructions...................................... 69 r rc oscillator....................................................................... 54 read-modify-write operations ............................. 69 registers adcon0 (a/d control)............................................... 43 ansel (analog select) .............................................. 44 cmcon (comparator control) ................................... 35 config (configuration word) ................................... 52 eeadr (eeprom address) ...................................... 47 eecon1 (eeprom control) ..................................... 48 eedat (eeprom data) ............................................ 47 intcon (interrupt control)......................................... 13 ioc (interrupt-on-change gpio)................................ 21 maps pic12F629 ........................................................... 8 pic12f675 ........................................................... 8 option_reg (option) ........................................ 12, 28 osccal (oscillator calibration) ................................ 16 pcon (power control) ............................................... 16 pie1 (peripheral interrupt enable 1)........................... 14 pir1 (peripheral interrupt 1)....................................... 15 status ..................................................................... 11 t1con (timer1 control) ............................................ 32 vrcon (voltage reference control) ......................... 40 wpu (weak pull-up)................................................... 20 reset................................................................................ 55 revision history................................................................ 121 s software simulator (mplab sim) ...................................... 78 software simulator (mplab sim30) .................................. 78 special features of the cpu .............................................. 51 special function registers ................................................... 8 special functions registers summary................................. 9 t time-out sequence ............................................................ 57 timer0................................................................................. 27 associated registers .................................................. 29 external clock............................................................. 28 interrupt ...................................................................... 27 operation .................................................................... 27 t0cki ......................................................................... 28 timer1 associated registers .................................................. 33 asynchronous counter mode ..................................... 33 reading and writing ........................................... 33 interrupt ...................................................................... 31 modes of operations .................................................. 31 operation during sleep............................................ 33 oscillator..................................................................... 33 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 125 pic12F629/675 prescaler..................................................................... 31 timer1 module with gate control ....................................... 30 timing diagrams clkout and i/o......................................................... 96 external clock............................................................. 94 int pin interrupt.......................................................... 63 pic12f675 a/d conversion (normal mode)............. 102 pic12f675 a/d conversion timing (sleep mode) .......................................................... 103 reset, watchdog timer, oscillator start-up timer and power-up timer ......................................... 97 time-out sequence on power-up (mclr not tied to v dd ) case 1 ................................................................ 60 case 2 ................................................................ 60 time-out sequence on power-up (mclr tied to v dd ).................................................... 60 timer0 and timer1 external clock ............................. 99 timer1 incrementing edge.......................................... 31 timing parameter symbology............................................. 93 v voltage reference accuracy/error ..................................... 39 w watchdog timer summary of registers ................................................ 65 watchdog timer (wdt) ...................................................... 64 www, on-line support ....................................................... 3 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 126 ? 2003 microchip technology inc. notes: .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 127 pic12F629/675 systems information and upgrade hot line the systems information and upgrade line provides system users a listing of the latest versions of all of microchip's development systems software products. plus, this line provides information on how customers can receive the most current upgrade kits.the hot line numbers are: 1-800-755-2345 for u.s. and most of canada, and 1-480-792-7302 for the rest of the world. on-line support microchip provides on-line support on the microchip world wide web site. the web site is used by microchip as a means to make files and information easily available to customers. to view the site, the user must have access to the internet and a web browser, such as netscape ? or microsoft ? internet explorer. files are also available for ftp download from our ftp site. connecting to the microchip internet web site the microchip web site is available at the following url: www.microchip.com the file transfer site is available by using an ftp service to connect to: ftp://ftp.microchip.com the web site and file transfer site provide a variety of services. users may download files for the latest development tools, data sheets, application notes, user's guides, articles and sample programs. a vari- ety of microchip specific business information is also available, including listings of microchip sales offices, distributors and factory representatives. other data available for consideration is:  latest microchip press releases  technical support section with frequently asked questions  design tips  device errata  job postings  microchip consultant program member listing  links to other useful web sites related to microchip products  conferences for products, development systems, technical information and more  listing of seminars and events 092002 .com .com .com .com 4 .com u datasheet
pic12F629/675 ds41190c-page 128 ? 2003 microchip technology inc. reader response it is our intention to provide you with the best documentation possible to ensure successful use of your microchip prod- uct. if you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation can better serve you, please fax your comments to the technical publications manager at (480) 792-4150. please list the following information, and use this outline to provide us with your comments about this document. 1. what are the best features of this document? 2. how does this document meet your hardware and software development needs? 3. do you find the organization of this document easy to follow? if not, why? 4. what additions to the document do you think would enhance the structure and subject? 5. what deletions from the document could be made without affecting the overall usefulness? 6. is there any incorrect or misleading information (what and where)? 7. how would you improve this document? to : technical publications manager re: reader response total pages sent ________ from: name company address city / state / zip / country telephone: (_______) _________ - _________ application (optional): would you like a reply? y n device: literature number: questions: fax: (______) _________ - _________ ds41190c pic12F629/675 .com .com .com .com 4 .com u datasheet
? 2003 microchip technology inc. ds41190c-page 129 pic12F629/675 product identification system to order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office. * jw devices are uv erasable and can be programmed to any device configuration. jw devices meet the electrical requirement of each oscillator type. sales and support data sheets products supported by a preliminary data sheet may have an errata sheet describing minor operational differences and recom- mended workarounds. to determine if an errata sheet exists for a particular device, please contact one of the following: 1. your local microchip sales office 2. the microchip corporate literature center u.s. fax: (480) 792-7277 3. the microchip worldwide site (www.microchip.com) please specify which device, revision of silicon and data sheet (include literature #) you are using. new customer notification system register on our web site (www.microchip.com/cn) to receive the most current information on our products. part no. x /xx xxx pattern package temperature range device device pic12f6xx: standard v dd range pic12f6xxt: (tape and reel) temperature range i = -40 c to +85 c e = -40 c to +125 c package p = pdip sn = soic (gull wing, 150 mil body) mf = mlf-s pattern 3-digit pattern code for qtp (blank otherwise) examples: a) pic12F629 ? e/p 301 = extended temp., pdip package, 20 mhz, qtp pattern #301 b) pic12f675 ? i/so = industrial temp., soic package, 20 mhz .com .com .com .com 4 .com u datasheet
ds41190c-page 130 ? 2003 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: 480-792-7627 web address: http://www.microchip.com rocky mountain 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7966 fax: 480-792-4338 atlanta 3780 mansell road, suite 130 alpharetta, ga 30022 tel: 770-640-0034 fax: 770-640-0307 boston 2 lan drive, suite 120 westford, ma 01886 tel: 978-692-3848 fax: 978-692-3821 chicago 333 pierce road, suite 180 itasca, il 60143 tel: 630-285-0071 fax: 630-285-0075 dallas 4570 westgrove drive, suite 160 addison, tx 75001 tel: 972-818-7423 fax: 972-818-2924 detroit tri-atria office building 32255 northwestern highway, suite 190 farmington hills, mi 48334 tel: 248-538-2250 fax: 248-538-2260 kokomo 2767 s. albright road kokomo, indiana 46902 tel: 765-864-8360 fax: 765-864-8387 los angeles 18201 von karman, suite 1090 irvine, ca 92612 tel: 949-263-1888 fax: 949-263-1338 san jose microchip technology inc. 2107 north first street, suite 590 san jose, ca 95131 tel: 408-436-7950 fax: 408-436-7955 toronto 6285 northam drive, suite 108 mississauga, ontario l4v 1x5, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific australia microchip technology australia pty ltd marketing support division suite 22, 41 rawson street epping 2121, nsw australia tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing microchip technology consulting (shanghai) co., ltd., beijing liaison office unit 915 bei hai wan tai bldg. no. 6 chaoyangmen beidajie beijing, 100027, no. china tel: 86-10-85282100 fax: 86-10-85282104 china - chengdu microchip technology consulting (shanghai) co., ltd., chengdu liaison office rm. 2401-2402, 24th floor, ming xing financial tower no. 88 tidu street chengdu 610016, china tel: 86-28-86766200 fax: 86-28-86766599 china - fuzhou microchip technology consulting (shanghai) co., ltd., fuzhou liaison office unit 28f, world trade plaza no. 71 wusi road fuzhou 350001, china tel: 86-591-7503506 fax: 86-591-7503521 china - hong kong sar microchip technology hongkong ltd. unit 901-6, tower 2, metroplaza 223 hing fong road kwai fong, n.t., hong kong tel: 852-2401-1200 fax: 852-2401-3431 china - shanghai microchip technology consulting (shanghai) co., ltd. room 701, bldg. b far east international plaza no. 317 xian xia road shanghai, 200051 tel: 86-21-6275-5700 fax: 86-21-6275-5060 china - shenzhen microchip technology consulting (shanghai) co., ltd., shenzhen liaison office rm. 1812, 18/f, building a, united plaza no. 5022 binhe road, futian district shenzhen 518033, china tel: 86-755-82901380 fax: 86-755-82966626 china - qingdao rm. b505a, fullhope plaza, no. 12 hong kong central rd. qingdao 266071, china tel: 86-532-5027355 fax: 86-532-5027205 india microchip technology inc. india liaison office marketing support division divyasree chambers 1 floor, wing a (a3/a4) no. 11, o?shaugnessey road bangalore, 560 025, india tel: 91-80-2290061 fax: 91-80-2290062 japan microchip technology japan k.k. benex s-1 6f 3-18-20, shinyokohama kohoku-ku, yokohama-shi kanagawa, 222-0033, japan tel: 81-45-471- 6166 fax: 81-45-471-6122 korea microchip technology korea 168-1, youngbo bldg. 3 floor samsung-dong, kangnam-ku seoul, korea 135-882 tel: 82-2-554-7200 fax: 82-2-558-5934 singapore microchip technology singapore pte ltd. 200 middle road #07-02 prime centre singapore, 188980 tel: 65-6334-8870 fax: 65-6334-8850 taiwan microchip technology (barbados) inc., taiwan branch 11f-3, no. 207 tung hua north road taipei, 105, taiwan tel: 886-2-2717-7175 fax: 886-2-2545-0139 europe austria microchip technology austria gmbh durisolstrasse 2 a-4600 wels austria tel: 43-7242-2244-399 fax: 43-7242-2244-393 denmark microchip technology nordic aps regus business centre lautrup hoj 1-3 ballerup dk-2750 denmark tel: 45 4420 9895 fax: 45 4420 9910 france microchip technology sarl parc d?activite du moulin de massy 43 rue du saule trapu batiment a - ler etage 91300 massy, france tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany microchip technology gmbh steinheilstrasse 10 d-85737 ismaning, germany tel: 49-089-627-144-100 fax: 49-089-627-144-44 italy microchip technology srl via quasimodo, 12 20025 legnano (mi) milan, italy tel: 39-0331-742611 fax: 39-0331-466781 united kingdom microchip ltd. 505 eskdale road winnersh triangle wokingham berkshire, england rg41 5tu tel: 44 118 921 5869 fax: 44-118 921-5820 02/12/03 w orldwide s ales and s ervice .com .com .com 4 .com u datasheet


▲Up To Search▲   

 
Price & Availability of 12F629

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X